Re: [PATCH] NFSv4: Force a post-op attribute update when holding a delegation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 20, 2015, at 9:59 PM, Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> wrote:

> If the ctime or mtime or change attribute have changed because
> of an operation we initiated, we should make sure that we force
> an attribute update. However we do not want to mark the page cache
> for revalidation.

I've tested your linux-next branch (tip is aebbe9d73169
("NFS41/flexfiles: zero out DS write wcc") against Solaris 12
with write delegation enabled (over RDMA, even!).

I was not able to reproduce the write append failures I saw
before.


> Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
> ---
> fs/nfs/inode.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> index 2744d48bbbfe..e2cc0031decb 100644
> --- a/fs/nfs/inode.c
> +++ b/fs/nfs/inode.c
> @@ -1477,6 +1477,13 @@ static int nfs_post_op_update_inode_locked(struct inode *inode, struct nfs_fattr
> {
> 	unsigned long invalid = NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
> 
> +	/*
> +	 * Don't revalidate the pagecache if we hold a delegation, but do
> +	 * force an attribute update
> +	 */
> +	if (NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
> +		invalid = NFS_INO_INVALID_ATTR|NFS_INO_REVAL_FORCED;
> +
> 	if (S_ISDIR(inode->i_mode))
> 		invalid |= NFS_INO_INVALID_DATA;
> 	nfs_set_cache_invalid(inode, invalid);
> -- 
> 2.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Chuck Lever



--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux