Skip to contentSkip to conversation

NFSv4: Force a post-op attribute update when holding a delegation

PATCH In review Trond Myklebust 2 participants 8 messages Aug 21, 2015 – Aug 25, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSv4: Force a post-op attribute update when holding a delegation

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.

---
 fs/nfs/inode.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/nfs/inode.c +7 -0
index 2744d48bbbfe..e2cc0031decb 100644
@@ -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);
Signature · 1 line
2.4.3
#1 lore raw
Quoted 4 lines · Trond Myklebust

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.

Quoted 30 lines

---
fs/nfs/inode.c | 7 +++++++

1 file changed, 7 insertions(+)
fs/nfs/inode.c +7 -0
index 2744d48bbbfe..e2cc0031decb 100644
@@ -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);
Signature · 6 lines
2.4.3

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

--
Chuck Lever

#2 lore raw
Quoted 8 lines · Chuck Lever
Quoted 4 lines · Trond Myklebust

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.

Quoted 7 lines

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.

Perfect. Thanks for testing!

Trond

#3 lore raw
Quoted 13 lines · Trond Myklebust
Quoted 12 lines · Chuck Lever
Quoted 4 lines · Trond Myklebust

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!).

Quoted 5 lines
Quoted 3 lines

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

Perfect. Thanks for testing!

Would it be possible to label some of these for stable?

--
Chuck Lever

#4 lore raw
Quoted 16 lines · Chuck Lever
Quoted 13 lines · Trond Myklebust
Quoted 12 lines · Chuck Lever
Quoted 4 lines · Trond Myklebust

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!).

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

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

Perfect. Thanks for testing!

Would it be possible to label some of these for stable?

I think this one is the only one that is missing such a label. I've reworded the commit message and pushed out a revised patch.

#5 lore raw
Quoted 21 lines · Trond Myklebust
Quoted 20 lines · Chuck Lever
Quoted 17 lines · Trond Myklebust
Quoted 15 lines · Chuck Lever
Quoted 4 lines · Trond Myklebust

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.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Perfect. Thanks for testing!

Would it be possible to label some of these for stable?

I think this one is the only one that is missing such a label. I've reworded the commit message and pushed out a revised patch.

Not related to the write append problem, but I've also seen missing opens on delegated files during reboot recovery in 4.0 kernels. Olga reported it before I got to it.

Is that one also appropriate for stable?

--
Chuck Lever

#6 lore raw
Quoted 29 lines · Chuck Lever
Quoted 26 lines · Trond Myklebust
Quoted 24 lines · Chuck Lever
Quoted 13 lines · Trond Myklebust
Quoted 12 lines · Chuck Lever
Quoted 4 lines · Trond Myklebust

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!).

Quoted 5 lines
Quoted 3 lines

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

Perfect. Thanks for testing!

Would it be possible to label some of these for stable?

Quoted 9 lines
Quoted 2 lines

I think this one is the only one that is missing such a label. I've reworded the commit message and pushed out a revised patch.

Not related to the write append problem, but I've also seen missing opens on delegated files during reboot recovery in 4.0 kernels. Olga reported it before I got to it.

Is that one also appropriate for stable?

I 've queued the revert of the patch that broke things for stable, but I didn't want to queue the new attempt at ensuring that we cache opens during a reboot reclaim...

#7 lore raw
Quoted 37 lines · Trond Myklebust
Quoted 36 lines · Chuck Lever
Quoted 21 lines · Trond Myklebust
Quoted 20 lines · Chuck Lever
Quoted 17 lines · Trond Myklebust
Quoted 15 lines · Chuck Lever
Quoted 4 lines · Trond Myklebust

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.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Perfect. Thanks for testing!

Would it be possible to label some of these for stable?

I think this one is the only one that is missing such a label. I've reworded the commit message and pushed out a revised patch.

Not related to the write append problem, but I've also seen missing opens on delegated files during reboot recovery in 4.0 kernels. Olga reported it before I got to it.

Quoted 6 lines
Quoted 2 lines

Is that one also appropriate for stable?

I 've queued the revert of the patch that broke things for stable, but I didn't want to queue the new attempt at ensuring that we cache opens during a reboot reclaim...

Understood, thank you!

--
Chuck Lever