]> git.karo-electronics.de Git - karo-tx-linux.git/commit
NFSv4.1: Fix a race in pNFS layoutcommit
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 20 Mar 2013 16:34:32 +0000 (12:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 16:25:56 +0000 (09:25 -0700)
commit9b8e85ac297b3fdfadd58f98cb09fb937555f678
tree225da72b32cbacfe3c1013be844757a82a7a1c9a
parentc648a421337d1dea3bb05ff035f03b88c4320299
NFSv4.1: Fix a race in pNFS layoutcommit

commit a073dbff359f4741013ae4b8395f5364c5e00b48 upstream.

We need to clear the NFS_LSEG_LAYOUTCOMMIT bits atomically with the
NFS_INO_LAYOUTCOMMIT bit, otherwise we may end up with situations
where the two are out of sync.
The first half of the problem is to ensure that pnfs_layoutcommit_inode
clears the NFS_LSEG_LAYOUTCOMMIT bit through pnfs_list_write_lseg.
We still need to keep the reference to those segments until the RPC call
is finished, so in order to make it clear _where_ those references come
from, we add a helper pnfs_list_write_lseg_done() that cleans up after
pnfs_list_write_lseg.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c
fs/nfs/pnfs.c