FreeBSD Bugzilla – Attachment 165690 Details for
Bug 206238
FUSE can't enter to DIRECT_IO mode during file create.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch fuse so it forces DIRECT_IO for WRONLY opens
fuse-wronly.patch (text/plain), 1.76 KB, created by
rmacklem
on 2016-01-16 23:22:02 UTC
(
hide
)
Description:
patch fuse so it forces DIRECT_IO for WRONLY opens
Filename:
MIME Type:
Creator:
rmacklem
Created:
2016-01-16 23:22:02 UTC
Size:
1.76 KB
patch
obsolete
>--- fs/fuse/fuse_file.c.xxx 2015-12-28 10:42:26.917855000 -0500 >+++ fs/fuse/fuse_file.c 2015-12-28 11:46:56.909454000 -0500 >@@ -141,7 +141,17 @@ fuse_filehandle_open(struct vnode *vp, > foo = fdi.answ; > > fuse_filehandle_init(vp, fufh_type, fufhp, foo->fh); >- fuse_vnode_open(vp, foo->open_flags, td); >+ >+ /* >+ * For WRONLY opens, force DIRECT_IO. This is necessary >+ * since writing a partial block through the buffer cache >+ * will result in a read of the block and that read won't >+ * be allowed by the WRONLY open. >+ */ >+ if (fufh_type == FUFH_WRONLY) >+ fuse_vnode_open(vp, foo->open_flags | FOPEN_DIRECT_IO, td); >+ else >+ fuse_vnode_open(vp, foo->open_flags, td); > > out: > fdisp_destroy(&fdi); >--- fs/fuse/fuse_vnops.c.xxx 2015-12-28 10:36:23.289297000 -0500 >+++ fs/fuse/fuse_vnops.c 2015-12-28 10:42:06.264737000 -0500 >@@ -1139,6 +1139,7 @@ fuse_vnop_open(struct vop_open_args *ap) > struct fuse_vnode_data *fvdat; > > int error, isdir = 0; >+ int32_t fuse_open_flags; > > FS_DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode); > >@@ -1150,14 +1151,23 @@ fuse_vnop_open(struct vop_open_args *ap) > if (vnode_isdir(vp)) { > isdir = 1; > } >+ fuse_open_flags = 0; > if (isdir) { > fufh_type = FUFH_RDONLY; > } else { > fufh_type = fuse_filehandle_xlate_from_fflags(mode); >+ /* >+ * For WRONLY opens, force DIRECT_IO. This is necessary >+ * since writing a partial block through the buffer cache >+ * will result in a read of the block and that read won't >+ * be allowed by the WRONLY open. >+ */ >+ if (fufh_type == FUFH_WRONLY) >+ fuse_open_flags = FOPEN_DIRECT_IO; > } > > if (fuse_filehandle_valid(vp, fufh_type)) { >- fuse_vnode_open(vp, 0, td); >+ fuse_vnode_open(vp, fuse_open_flags, td); > return 0; > } > error = fuse_filehandle_open(vp, fufh_type, NULL, td, cred);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 206238
: 165690 |
165691