diff options
| author | Sage Weil <sage@redhat.com> | 2014-09-26 08:30:06 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-30 09:35:09 -0700 |
| commit | aea9dd519b41025500e678587908705ad499ac38 (patch) | |
| tree | 70b8b7b9a670c78b5e682dada45527995f62193f /include/linux/errqueue.h | |
| parent | 5525f742eb55f40c1080c5ffb39a09978d5c50ba (diff) | |
Btrfs: fix race in WAIT_SYNC ioctl
commit 42383020beb1cfb05f5d330cc311931bc4917a97 upstream.
We check whether transid is already committed via last_trans_committed and
then search through trans_list for pending transactions. If
last_trans_committed is updated by btrfs_commit_transaction after we check
it (there is no locking), we will fail to find the committed transaction
and return EINVAL to the caller. This has been observed occasionally by
ceph-osd (which uses this ioctl heavily).
Fix by rechecking whether the provided transid <= last_trans_committed
after the search fails, and if so return 0.
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions
