]> git.baikalelectronics.ru Git - kernel.git/commit
quota: fix wrong condition in is_quota_modification()
authorChao Yu <yuchao0@huawei.com>
Wed, 11 Sep 2019 09:36:50 +0000 (17:36 +0800)
committerJan Kara <jack@suse.cz>
Thu, 12 Sep 2019 10:09:16 +0000 (12:09 +0200)
commitc2315eacade8cd5dd3ba4d466e31935d8fff5c36
tree6f1ba9c024c3c573f368d0cbb9f9870c945cb696
parent6494fcffde65805061a7c0402d453b7bc01b8a7c
quota: fix wrong condition in is_quota_modification()

Quoted from
commit ffe1473dd30f ("ext4: only call ext4_truncate when size <= isize")

" At LSF we decided that if we truncate up from isize we shouldn't trim
  fallocated blocks that were fallocated with KEEP_SIZE and are past the
 new i_size.  This patch fixes ext4 to do this. "

And generic/092 of fstest have covered this case for long time, however
is_quota_modification() didn't adjust based on that rule, so that in
below condition, we will lose to quota block change:
- fallocate blocks beyond EOF
- remount
- truncate(file_path, file_size)

Fix it.

Link: https://lore.kernel.org/r/20190911093650.35329-1-yuchao0@huawei.com
Fixes: ffe1473dd30f ("ext4: only call ext4_truncate when size <= isize")
CC: stable@vger.kernel.org
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
include/linux/quotaops.h