linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] zero layout stateid on last layout segment removal
@ 2010-07-14 17:05 andros
  2010-07-14 17:05 ` [PATCH 1/1] SQUASHME pnfs-submit " andros
  0 siblings, 1 reply; 2+ messages in thread
From: andros @ 2010-07-14 17:05 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs


This is a piece of the "pnfs-submit Re-initialize pnfs_layout_type when segs
list is emtpy" patch set that I think is not being argued about.

More initialization needs to occur when the layout->segs list is empty.

This patch fixes the bug where a layoutreturn would empty the nfs_inode->layout
segs list, and a future layoutget would use a (now-stale) stateid instead of
creating a new layout stateid from an existing open/lock/deleg stateid.

layoutget decides to get a new stateid when the nfs_layout->layout->stateid is
zeroed.

Testing;

CONFIG_NFS_V4_1 set:
Passes Connectathon (pnfs mount).
Behaves correctly in pyNFS file layout server tests where return-on-close is
set - every layoutget uses a new stateid.

CONFIG_NFS_V4_1 not set:
NFsv4.0 passses connectathon

-->Andy

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] SQUASHME pnfs-submit zero layout stateid on last layout segment removal
  2010-07-14 17:05 [PATCH 0/1] zero layout stateid on last layout segment removal andros
@ 2010-07-14 17:05 ` andros
  0 siblings, 0 replies; 2+ messages in thread
From: andros @ 2010-07-14 17:05 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs, Andy Adamson

From: Andy Adamson <andros@netapp.com>

Section 12.5.3 RFC 5661

"Once a client has no more layouts on a file, the layout stateid is no longer
valid and MUST NOT be used. Any attempt to use such a layout stateid will
result in NFS4ERR_BAD_STATEID."

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/pnfs.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 8b26104..3018ed6 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -625,6 +625,7 @@ pnfs_free_layout(struct pnfs_layout_type *lo,
 		spin_lock(&clp->cl_lock);
 		list_del_init(&lo->lo_layouts);
 		spin_unlock(&clp->cl_lock);
+		pnfs_set_layout_stateid(lo, &zero_stateid);
 	}
 
 	dprintk("%s:Return\n", __func__);
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-14 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-14 17:05 [PATCH 0/1] zero layout stateid on last layout segment removal andros
2010-07-14 17:05 ` [PATCH 1/1] SQUASHME pnfs-submit " andros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).