nfsd: delegated timestamp fix
Subsystems (2)
Jeff Layton
maintainercover nfsd: delegated timestamp fix
The first patch fixes a bug I found with delegated timestamps, and the second makes the warning message that prompted the fix more distinct.
This is probably fine to wait until v7.0, but I think it's safe to take them sooner since it is a bugfix.
---
Jeff Layton (2):
nfsd: use ATTR_DELEG in nfsd4_finalize_deleg_timestamps()
nfsd: prefix notification in nfsd4_finalize_deleg_timestamps() with "nfsd: "
fs/nfsd/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 8c83500a552a34821bf9d865aec5a5588b4cfe7c
change-id: 20251203-nfsd-7-0-9b02ed10e407
Best regards,
Signature · 1 line
Jeff Layton <[email protected]>
Jeff Layton
maintainerPATCH 1/2 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.
--- fs/nfsd/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -1
@@ -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;
Signature · 1 line
2.52.0
Jeff Layton
maintainerPATCH 2/2 nfsd: prefix notification in nfsd4_finalize_deleg_timestamps() with "nfsd: "
In reply to Jeff LaytonMake it distinct that this message comes from nfsd.
--- fs/nfsd/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -1
@@ -1253,7 +1253,7 @@ static void nfsd4_finalize_deleg_timestamps(struct nfs4_delegation *dp, struct fif (ret) {struct inode *inode =file_inode (f); -pr_notice_ratelimited ("Unable to update timestamps on inode %02x:%02x:%lu: %d\n" , +pr_notice_ratelimited ("nfsd: Unable to update timestamps on inode %02x:%02x:%lu: %d\n" ,MAJOR (inode->i_sb->s_dev),MINOR (inode->i_sb->s_dev), inode->i_ino, ret);
Signature · 1 line
2.52.0
Chuck Lever
maintainerFrom: Chuck Lever <[email protected]>
Quoted 8 lines · Jeff Layton
The first patch fixes a bug I found with delegated timestamps, and the second makes the warning message that prompted the fix more distinct.
This is probably fine to wait until v7.0, but I think it's safe to take them sooner since it is a bugfix.
[...]
Applied to nfsd-testing, thanks!
[1/2] nfsd: use ATTR_DELEG in nfsd4_finalize_deleg_timestamps()
commit: f0cba9453ad1a29679bd3d872aee5dd691b84d1d
[2/2] nfsd: prefix notification in nfsd4_finalize_deleg_timestamps() with "nfsd: "
commit: 1f0bbd7fd62f1f00ecf0df3dc53083d2205d994d--
Chuck Lever