Commit 8f9e9678 authored by Jeff Layton's avatar Jeff Layton Committed by Chuck Lever
Browse files

nfsd: use ATTR_DELEG in nfsd4_finalize_deleg_timestamps()



When finalizing timestamps that have never been updated and preparing to
release the delegation lease, the notify_change() call can trigger a
delegation break, and fail to update the timestamps. When this happens,
there will be messages like this in dmesg:

    [ 2709.375785] Unable to update timestamps on inode 00:39:263: -11

Since this code is going to release the lease just after updating the
timestamps, breaking the delegation is undesirable. Fix this by setting
ATTR_DELEG in ia_valid, in order to avoid the delegation break.

Fixes: e5e9b24a ("nfsd: freeze c/mtime updates with outstanding WRITE_ATTRS delegation")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 8072e34e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1226,7 +1226,7 @@ static void put_deleg_file(struct nfs4_file *fp)

static void nfsd4_finalize_deleg_timestamps(struct nfs4_delegation *dp, struct file *f)
{
	struct iattr ia = { .ia_valid = ATTR_ATIME | ATTR_CTIME | ATTR_MTIME };
	struct iattr ia = { .ia_valid = ATTR_ATIME | ATTR_CTIME | ATTR_MTIME | ATTR_DELEG };
	struct inode *inode = file_inode(f);
	int ret;