[PATCH] ext4: move check under lock to avoid race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I originally thought that ext4_zero_range() and ext4_collapse() range
duplicated the check in fallocate(), performing it under the lock.
Dmitry explained to me how I was wrong, because there's nothing to
prevent ioctl() to convert indirect <==> extent, so the check needs to
be done with the inode lock held.
Further inspection showed that ext4_fallocate() doesn't re-check inside
the lock scope so I'm not entirely sure it's safe. 
I propose this patch that moves the check inside the lock scope to
guarantee safeness. My original point remains, i.e. there's no need to
duplicate it, in particular if there's nothing that prevents things to
change.
I hope this (take two) is slightly more correct.

Davide Italiano (1):
  ext4: Move check under lock scope to close a race.

 fs/ext4/extents.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

-- 
2.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux