FreeBSD Bugzilla – Attachment 229053 Details for
Bug 259071
Read past EoF in NFS client and fusefs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
timestamp file mods so Lookup can discard stale attributes against Writing
write.patch (text/plain), 2.24 KB, created by
Rick Macklem
on 2021-10-26 23:46:59 UTC
(
hide
)
Description:
timestamp file mods so Lookup can discard stale attributes against Writing
Filename:
MIME Type:
Creator:
Rick Macklem
Created:
2021-10-26 23:46:59 UTC
Size:
2.24 KB
patch
obsolete
>--- sys/fs/nfsclient/nfs_clbio.c.write 2021-10-24 20:41:18.738471000 -0700 >+++ sys/fs/nfsclient/nfs_clbio.c 2021-10-25 09:24:08.902139000 -0700 >@@ -906,6 +906,7 @@ ncl_write(struct vop_write_args *ap) > int bp_cached, n, on, error = 0, error1, save2, wouldcommit; > size_t orig_resid, local_resid; > off_t orig_size, tmp_off; >+ struct timespec ts; > > KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); > KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, >@@ -1283,7 +1284,12 @@ again: > break; > } while (uio->uio_resid > 0 && n > 0); > >- if (error != 0) { >+ if (error == 0) { >+ nanouptime(&ts); >+ NFSLOCKNODE(np); >+ np->n_localmodtime = ts; >+ NFSUNLOCKNODE(np); >+ } else { > if (ioflag & IO_UNIT) { > VATTR_NULL(&vattr); > vattr.va_size = orig_size; >@@ -1355,6 +1361,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre > struct nfsmount *nmp = VFSTONFS(vp->v_mount); > int error = 0, slpflag, slptimeo; > bool old_lock; >+ struct timespec ts; > > ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf"); > >@@ -1399,16 +1406,21 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre > } > if (NFSHASPNFS(nmp)) { > nfscl_layoutcommit(vp, td); >+ nanouptime(&ts); > /* > * Invalidate the attribute cache, since writes to a DS > * won't update the size attribute. > */ > NFSLOCKNODE(np); > np->n_attrstamp = 0; >- } else >+ } else { >+ nanouptime(&ts); > NFSLOCKNODE(np); >- if (np->n_directio_asyncwr == 0) >+ } >+ if (np->n_directio_asyncwr == 0 && (np->n_flag & NMODIFIED) != 0) { >+ np->n_localmodtime = ts; > np->n_flag &= ~NMODIFIED; >+ } > NFSUNLOCKNODE(np); > out: > ncl_excl_finish(vp, old_lock); >--- sys/fs/nfsclient/nfs_clvnops.c.write 2021-10-24 20:55:41.564230000 -0700 >+++ sys/fs/nfsclient/nfs_clvnops.c 2021-10-25 09:24:20.883045000 -0700 >@@ -2896,6 +2896,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct thread > #endif > struct buf *bvec_on_stack[NFS_COMMITBVECSIZ]; > u_int bvecsize = 0, bveccount; >+ struct timespec ts; > > if (called_from_renewthread != 0) > slptimeo = hz; >@@ -3215,6 +3216,12 @@ done: > } > vn_printf(vp, "ncl_flush failed"); > error = called_from_renewthread != 0 ? EIO : EBUSY; >+ } >+ if (error == 0) { >+ nanouptime(&ts); >+ NFSLOCKNODE(np); >+ np->n_localmodtime = ts; >+ NFSUNLOCKNODE(np); > } > return (error); > }
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 259071
:
228584
|
228935
|
228973
| 229053