FreeBSD Bugzilla – Attachment 196191 Details for
Bug 230258
[FUSE] [BUG]: Attributes caching issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
changed filesize handling in fuse file system
fuse_filesize.patch (text/plain), 4.16 KB, created by
Jakub Kruszona-Zawadzki
on 2018-08-14 08:30:43 UTC
(
hide
)
Description:
changed filesize handling in fuse file system
Filename:
MIME Type:
Creator:
Jakub Kruszona-Zawadzki
Created:
2018-08-14 08:30:43 UTC
Size:
4.16 KB
patch
obsolete
>--- sys/fs/fuse/fuse_io.c.orig 2018-08-14 10:02:10.165074000 +0200 >+++ sys/fs/fuse/fuse_io.c 2018-08-14 10:02:50.540872000 +0200 >@@ -596,8 +596,8 @@ > break; > } while (uio->uio_resid > 0 && n > 0); > >- if (fuse_sync_resize && (fvdat->flag & FN_SIZECHANGE) != 0) >- fuse_vnode_savesize(vp, cred); >+// if (fuse_sync_resize && (fvdat->flag & FN_SIZECHANGE) != 0) >+// fuse_vnode_savesize(vp, cred); > > return (err); > } >--- sys/fs/fuse/fuse_node.c.orig 2018-08-14 10:00:09.059297000 +0200 >+++ sys/fs/fuse/fuse_node.c 2018-08-14 10:00:58.106649000 +0200 >@@ -304,6 +304,7 @@ > } > } > >+#if 0 > int > fuse_vnode_savesize(struct vnode *vp, struct ucred *cred) > { >@@ -366,6 +367,7 @@ > VOP_GETATTR(vp, &va, cred); > FS_DEBUG("refreshed file size: %jd\n", (intmax_t)VTOFUD(vp)->filesize); > } >+#endif > > int > fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize) >@@ -381,7 +383,7 @@ > > oldsize = fvdat->filesize; > fvdat->filesize = newsize; >- fvdat->flag |= FN_SIZECHANGE; >+// fvdat->flag |= FN_SIZECHANGE; > > if (newsize < oldsize) { > err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp)); >--- sys/fs/fuse/fuse_node.h.orig 2018-08-14 10:01:32.412038000 +0200 >+++ sys/fs/fuse/fuse_node.h 2018-08-14 10:01:47.483261000 +0200 >@@ -68,7 +68,7 @@ > #define FN_REVOKED 0x00000020 > #define FN_FLUSHINPROG 0x00000040 > #define FN_FLUSHWANT 0x00000080 >-#define FN_SIZECHANGE 0x00000100 >+// #define FN_SIZECHANGE 0x00000100 > #define FN_DIRECTIO 0x00000200 > > struct fuse_vnode_data { >--- sys/fs/fuse/fuse_vnops.c.orig 2018-08-10 09:34:24.492125000 +0200 >+++ sys/fs/fuse/fuse_vnops.c 2018-08-14 09:59:57.120200000 +0200 >@@ -302,9 +302,9 @@ > " (fflag=0x%x)\n", > fufh_type, fflag); > } >- if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { >- fuse_vnode_savesize(vp, cred); >- } >+// if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { >+// fuse_vnode_savesize(vp, cred); >+// } > return 0; > } > >@@ -527,10 +527,10 @@ > err = ENOENT; > goto out; > } >- if ((fvdat->flag & FN_SIZECHANGE) != 0) >- vap->va_size = fvdat->filesize; >+// if ((fvdat->flag & FN_SIZECHANGE) != 0) >+// vap->va_size = fvdat->filesize; > >- if (vnode_isreg(vp) && (fvdat->flag & FN_SIZECHANGE) == 0) { >+ if (vnode_isreg(vp)/* && (fvdat->flag & FN_SIZECHANGE) == 0*/) { > /* > * This is for those cases when the file size changed without us > * knowing, and we want to catch up. >@@ -578,9 +578,9 @@ > fufh = &(fvdat->fufh[type]); > if (FUFH_IS_VALID(fufh)) { > if (need_flush && vp->v_type == VREG) { >- if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { >- fuse_vnode_savesize(vp, NULL); >- } >+// if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { >+// fuse_vnode_savesize(vp, NULL); >+// } > if (fuse_data_cache_invalidate || > (fvdat->flag & FN_REVOKED) != 0) > fuse_io_invalbuf(vp, td); >@@ -823,6 +823,7 @@ > > struct fuse_entry_out *feo = NULL; > struct fuse_attr *fattr = NULL; >+ struct fuse_vnode_data *fvdat = NULL; > > if (op == FUSE_GETATTR) { > fattr = &((struct fuse_attr_out *)fdi.answ)->attr; >@@ -971,6 +972,19 @@ > cache_attrs(*vpp, (struct fuse_entry_out *)fdi.answ); > } > >+ fvdat = VTOFUD(*vpp); >+ >+ if (vnode_isreg(*vpp)/* && (fvdat->flag & FN_SIZECHANGE) == 0*/) { >+ /* >+ * This is for those cases when the file size changed without us >+ * knowing, and we want to catch up. >+ */ >+ off_t new_filesize = fattr->size; >+ >+ if (fvdat->filesize != new_filesize) { >+ fuse_vnode_setsize(*vpp, cred, new_filesize); >+ } >+ } > /* Insert name into cache if appropriate. */ > > /* >@@ -1652,7 +1666,7 @@ > fdisp_destroy(&fdi); > if (!err && sizechanged) { > fuse_vnode_setsize(vp, cred, newsize); >- VTOFUD(vp)->flag &= ~FN_SIZECHANGE; >+// VTOFUD(vp)->flag &= ~FN_SIZECHANGE; > } > return err; > } >@@ -1677,8 +1691,8 @@ > bufdone(bp); > return ENXIO; > } >- if (bp->b_iocmd == BIO_WRITE) >- fuse_vnode_refreshsize(vp, NOCRED); >+// if (bp->b_iocmd == BIO_WRITE) >+// fuse_vnode_refreshsize(vp, NOCRED); > > (void)fuse_io_strategy(vp, bp); > >@@ -1765,7 +1779,7 @@ > if (fuse_isdeadfs(vp)) { > return ENXIO; > } >- fuse_vnode_refreshsize(vp, cred); >+// fuse_vnode_refreshsize(vp, cred); > > if (VTOFUD(vp)->flag & FN_DIRECTIO) { > ioflag |= IO_DIRECT;
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 230258
:
196048
|
196191
|
196192