]> git.baikalelectronics.ru Git - kernel.git/commit
pnfs/filelayout: fix race between mark_request_commit and scan_commit_lists
authorPeng Tao <tao.peng@primarydata.com>
Thu, 3 Jul 2014 05:07:45 +0000 (13:07 +0800)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 12 Jul 2014 22:22:41 +0000 (18:22 -0400)
commitee6081f43a2fd6ab4477aade2e27d6607b02c9cd
tree076a698314f3ae471eb849580996d0b4a221b13c
parent210049b18649a9472c60af7f02c2e5a96dd050e5
pnfs/filelayout: fix race between mark_request_commit and scan_commit_lists

We need to hold cinfo lock while setting bucket->wlseg and adding req to nwritten
list at the same time. Otherwise there might be a window where nwritten list
is empty yet we set bucket->wlseg, in which case ff_layout_scan_ds_commit_list()
may end up clearing bucket->wlseg incorrectly, casuing client to oops later on.

This was found when testing flexfile layout but filelayout has the same problem.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/filelayout/filelayout.c