diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2013-06-21 22:26:18 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2013-06-21 22:26:18 +0000 |
commit | b3e84941b0d829d5e6cba05791c20e155ae80365 (patch) | |
tree | 6ab0c8fb5386632fac4f876f6c0ba1d38f2c169e /sys/fs/nfsclient/nfs_clvnops.c | |
parent | 2bc76c9d964e90f6acf4e47a2b0642ab27888130 (diff) | |
download | FreeBSD-src-b3e84941b0d829d5e6cba05791c20e155ae80365.zip FreeBSD-src-b3e84941b0d829d5e6cba05791c20e155ae80365.tar.gz |
When the NFSv4.1 client is writing to a pNFS Data Server (DS), the
file's size attribute does not get updated. As such, it is necessary
to invalidate the attribute cache before clearing NMODIFIED for pNFS.
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfsclient/nfs_clvnops.c')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index dad5969..944873c 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -2951,9 +2951,16 @@ loop: mtx_unlock(&np->n_mtx); } else BO_UNLOCK(bo); - if (NFSHASPNFS(nmp)) + if (NFSHASPNFS(nmp)) { nfscl_layoutcommit(vp, td); - mtx_lock(&np->n_mtx); + /* + * Invalidate the attribute cache, since writes to a DS + * won't update the size attribute. + */ + mtx_lock(&np->n_mtx); + np->n_attrstamp = 0; + } else + mtx_lock(&np->n_mtx); if (np->n_flag & NWRITEERR) { error = np->n_error; np->n_flag &= ~NWRITEERR; |