Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109889342
D42625.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
830 B
Referenced Files
None
Subscribers
None
D42625.diff
View Options
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
@@ -879,23 +879,11 @@
td = ap->a_fsizetd;
pid = td->td_proc->p_pid;
- /* Lock both vnodes, avoiding risk of deadlock. */
- do {
- err = vn_lock(outvp, LK_EXCLUSIVE);
- if (invp == outvp)
- break;
- if (err == 0) {
- err = vn_lock(invp, LK_SHARED | LK_NOWAIT);
- if (err == 0)
- break;
- VOP_UNLOCK(outvp);
- err = vn_lock(invp, LK_SHARED);
- if (err == 0)
- VOP_UNLOCK(invp);
- }
- } while (err == 0);
- if (err != 0)
- return (err);
+ vn_lock_pair(invp, false, LK_SHARED, outvp, false, LK_EXCLUSIVE);
+ if (invp->v_data == NULL || outvp->v_data == NULL) {
+ err = EBADF;
+ goto unlock;
+ }
err = fuse_filehandle_getrw(invp, FREAD, &infufh, incred, pid);
if (err)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 8:01 PM (15 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16600337
Default Alt Text
D42625.diff (830 B)
Attached To
Mode
D42625: fuse copy_file_range() fixes
Attached
Detach File
Event Timeline
Log In to Comment