History

quota: fix wrong condition in is_quota_modification()

Quoted from commit 3da40c7b0898 ("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.

Chao Yu committed 7 years ago

Commit 6565c181 parent 4eb09e11 file · +1 −1Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/quotaops.h+1−1
@@ -22,7 +22,7 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb) · 21 unmodified lines
2222 /* i_mutex must being held */
2323 static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
2424 {
25− return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) ||
25+ return (ia->ia_valid & ATTR_SIZE) ||
2626 (ia->ia_valid & ATTR_UID && !uid_eq(ia->ia_uid, inode->i_uid)) ||
2727 (ia->ia_valid & ATTR_GID && !gid_eq(ia->ia_gid, inode->i_gid));
2828 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t