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)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:41 +0000 (19:12 -0400)
commite5975e422e51281bcaea4c98f954a70916f58906
tree7cfb3aa4e57b14c7f884ad0e9cabd36fc6729bc6
parent826e9b94ce8cd724866d6fc86d614db97730abcf
ext4: move check under lock scope to close a race.

[ Upstream commit 280227a75b56ab5d35854f3a77ef74a7ad56a203 ]

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>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/ext4/extents.c