]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix how we deal with the orphan block rsv
authorJosef Bacik <josef@redhat.com>
Wed, 23 May 2012 18:26:42 +0000 (14:26 -0400)
committerJosef Bacik <josef@redhat.com>
Wed, 30 May 2012 14:23:37 +0000 (10:23 -0400)
commit442caa3cb3440b5818d52dfca18daf1d978efed3
tree8adb116747b84209406d29767b56e2a6ade2f2f4
parent7679aa06280553ce61cbe0ba6ad6783e43d70792
Btrfs: fix how we deal with the orphan block rsv

Ceph was hitting this race where we would remove an inode from the per-root
orphan list before we would release the space we had reserved for the inode.
We actually don't need a list or anything, we just need to make sure the
root doesn't try to free up the orphan reserve until after the inodes have
released their reservations.  So use an atomic counter instead of a list on
the root and only decrement the counter after we've released our
reservation.  I've tested this as well as several others and we no longer
see the warnings that you would see while running ceph.  Thanks,
Btrfs: fix how we deal with the orphan block rsv

Ceph was hitting this race where we would remove an inode from the per-root
orphan list before we would release the space we had reserved for the inode.
We actually don't need a list or anything, we just need to make sure the
root doesn't try to free up the orphan reserve until after the inodes have
released their reservations.  So use an atomic counter instead of a list on
the root and only decrement the counter after we've released our
reservation.  I've tested this as well as several others and we no longer
see the warnings that you would see while running ceph.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/inode.c