]> git.karo-electronics.de Git - linux-beck.git/commit
Btrfs: do not check delalloc when updating disk_i_size
authorJosef Bacik <josef@redhat.com>
Wed, 2 May 2012 17:52:09 +0000 (13:52 -0400)
committerJosef Bacik <josef@redhat.com>
Wed, 30 May 2012 14:23:33 +0000 (10:23 -0400)
commit4e89915220e2f1341c757b610d0f0c3821f3a65f
tree5c70b0fab1d05a924ce316e8ba632b95b6555c16
parentf60d16a8923201bb27ad7c09016abab2818cf8ce
Btrfs: do not check delalloc when updating disk_i_size

We are checking delalloc to see if it is ok to update the i_size.  There are
2 cases it stops us from updating

1) If there is delalloc between our current disk_i_size and this ordered
extent

2) If there is delalloc between our current ordered extent and the next
ordered extent

These tests are racy however since we can set delalloc for these ranges at
any time.  Also for the first case if we notice there is delalloc between
disk_i_size and our ordered extent we will not update disk_i_size and assume
that when that delalloc bit gets written out it will update everything
properly.  However if we crash before that we will have file extents outside
of our i_size, which is not good, so this test is dangerous as well as racy.
Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/ordered-data.c