Page MenuHomeFreeBSD

D27936.diff
No OneTemporary

D27936.diff

diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c
--- a/sys/fs/fuse/fuse_vnops.c
+++ b/sys/fs/fuse/fuse_vnops.c
@@ -432,18 +432,6 @@
return ENXIO;
}
- if (!(dataflags & FSESS_POSIX_LOCKS))
- return vop_stdadvlock(ap);
- /* FUSE doesn't properly support flock until protocol 7.17 */
- if (flags & F_FLOCK)
- return vop_stdadvlock(ap);
-
- err = fuse_filehandle_get_anyflags(vp, &fufh, cred, pid);
- if (err)
- return err;
-
- fdisp_init(&fdi, sizeof(*fli));
-
switch(ap->a_op) {
case F_GETLK:
op = FUSE_GETLK;
@@ -458,6 +446,20 @@
return EINVAL;
}
+ if (!(dataflags & FSESS_POSIX_LOCKS))
+ return vop_stdadvlock(ap);
+ /* FUSE doesn't properly support flock until protocol 7.17 */
+ if (flags & F_FLOCK)
+ return vop_stdadvlock(ap);
+
+ vn_lock(vp, LK_SHARED | LK_RETRY);
+
+ err = fuse_filehandle_get_anyflags(vp, &fufh, cred, pid);
+ if (err)
+ goto out;
+
+ fdisp_init(&fdi, sizeof(*fli));
+
fdisp_make_vp(&fdi, op, vp, td, cred);
fli = fdi.indata;
fli->fh = fufh->fh_id;
@@ -487,6 +489,8 @@
}
}
+out:
+ VOP_UNLOCK(vp);
return err;
}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 2:45 PM (22 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14718340
Default Alt Text
D27936.diff (1 KB)

Event Timeline