ext4: move check under lock scope to close a race.
authorDavide Italiano <dccitaliano@gmail.com>
Sun, 3 May 2015 03:21:15 +0000 (23:21 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:09 +0000 (00:32 +0100)
commit4209178b876408926ef6f02e51dd447bcebde977
tree71858160a04b238f99fb6a1871ad8af15f84afbc
parent7807354f17297234692897fd5a0700e79b7949a9
ext4: move check under lock scope to close a race.

commit 280227a75b56ab5d35854f3a77ef74a7ad56a203 upstream.

fallocate() checks that the file is extent-based and returns
EOPNOTSUPP in case is not. Other tasks can convert from and to
indirect and extent so it's safe to check only after grabbing
the inode mutex.

Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
[bwh: Backported to 3.2:
 - Adjust context
 - Add the 'out' label]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/extents.c