]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: protect orphan block rsv with spin_lock
authorJosef Bacik <josef@redhat.com>
Fri, 2 Dec 2011 20:44:12 +0000 (15:44 -0500)
committerGuru Anbalagane <guru.anbalagane@oracle.com>
Fri, 27 Jan 2012 01:21:14 +0000 (17:21 -0800)
commita3fa4134d64f64c671acb1298274f21f6f5cd27c
tree286cfaaad629317cd7e8f9bf70d1af2bfdb8464b
parent0061ccdeec7047be701dbfc811858b73e49dfd61
Btrfs: protect orphan block rsv with spin_lock

We've been seeing warnings coming out of the orphan commit stuff forever from
ceph.  Turns out it's because we're racing with checking if the orphan block
reserve is set, because we clear it outside of the spin_lock.  So leave the
normal fastpath checks where they are, but take the spin_lock and _recheck_ to
make sure we haven't had an orphan block rsv added in the meantime.  Then clear
the root's orphan block rsv and release the lock.  With this patch a user said
the warnings went away and they usually showed up pretty soon after he started
ceph.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 90290e19820e3323ce6b9c2888eeb68bf29c278b)
fs/btrfs/inode.c