summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-10-29 15:37:34 -0400
committerChris Mason <chris.mason@oracle.com>2010-10-29 15:37:34 -0400
commit99d16cbcaf694c803a1b6bf7e851694ffe1d255d (patch)
treedacf7f8eca75dc0d92566b5d3876f3efe8196e35 /fs/btrfs/transaction.h
parentfccdae435c1b295cca546f23f6f43126a28ffac3 (diff)
downloadop-kernel-dev-99d16cbcaf694c803a1b6bf7e851694ffe1d255d.zip
op-kernel-dev-99d16cbcaf694c803a1b6bf7e851694ffe1d255d.tar.gz
Btrfs: fix deadlock in btrfs_commit_transaction
We calculate timeout (either 1 or MAX_SCHEDULE_TIMEOUT) based on whether num_writers > 1 or should_grow at the top of the loop. Then, much much later, we wait for that timeout if either num_writers or should_grow is true. However, it's possible for a racing process (calling btrfs_end_transaction()) to decrement num_writers such that we wait forever instead of for 1. Fix this by deciding how long to wait when we wait. Include a smp_mb() before checking if the waitqueue is active to ensure the num_writers is visible. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud