diff options
author | Peng Tao <bergwolf@gmail.com> | 2011-10-23 23:21:17 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-10-31 11:51:28 -0400 |
commit | 92407e75ce45b41c46944891711fd8faf0714d84 (patch) | |
tree | 6616482a99f4b328f2a2acc853af20f273faf08f /fs/nfs/nfs4proc.c | |
parent | e20de377578e9504f8467c05ab1db98b4935d4ed (diff) |
nfs4: serialize layoutcommit
Current pnfs_layoutcommit_inode can not handle parallel layoutcommit.
And as Trond suggested , there is no need for client to optimize for
parallel layoutcommit. So add NFS_INO_LAYOUTCOMMITTING flag to
mark inflight layoutcommit and serialize lalyoutcommit with it.
Also mark_inode_dirty_sync if pnfs_layoutcommit_inode fails to issue
layoutcommit.
Reported-by: Vitaliy Gusev <gusev.vitaliy@nexenta.com>
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d2ae413c986a..b60fddf606f7 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -5950,6 +5950,7 @@ static void nfs4_layoutcommit_release(void *calldata) | |||
5950 | { | 5950 | { |
5951 | struct nfs4_layoutcommit_data *data = calldata; | 5951 | struct nfs4_layoutcommit_data *data = calldata; |
5952 | struct pnfs_layout_segment *lseg, *tmp; | 5952 | struct pnfs_layout_segment *lseg, *tmp; |
5953 | unsigned long *bitlock = &NFS_I(data->args.inode)->flags; | ||
5953 | 5954 | ||
5954 | pnfs_cleanup_layoutcommit(data); | 5955 | pnfs_cleanup_layoutcommit(data); |
5955 | /* Matched by references in pnfs_set_layoutcommit */ | 5956 | /* Matched by references in pnfs_set_layoutcommit */ |
@@ -5959,6 +5960,11 @@ static void nfs4_layoutcommit_release(void *calldata) | |||
5959 | &lseg->pls_flags)) | 5960 | &lseg->pls_flags)) |
5960 | put_lseg(lseg); | 5961 | put_lseg(lseg); |
5961 | } | 5962 | } |
5963 | |||
5964 | clear_bit_unlock(NFS_INO_LAYOUTCOMMITTING, bitlock); | ||
5965 | smp_mb__after_clear_bit(); | ||
5966 | wake_up_bit(bitlock, NFS_INO_LAYOUTCOMMITTING); | ||
5967 | |||
5962 | put_rpccred(data->cred); | 5968 | put_rpccred(data->cred); |
5963 | kfree(data); | 5969 | kfree(data); |
5964 | } | 5970 | } |