Skip to content

Commit 9ef06ce

Browse files
Lukas Czernertytso
authored andcommitted
ext4: remove unnecessary check for APPEND and IMMUTABLE
All the checks IS_APPEND and IS_IMMUTABLE for the fallocate operation on the inode are done in vfs. No need to do this again in ext4. Remove it. Signed-off-by: Lukas Czerner <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
1 parent 622cad1 commit 9ef06ce

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

fs/ext4/extents.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5398,12 +5398,6 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
53985398
/* Take mutex lock */
53995399
mutex_lock(&inode->i_mutex);
54005400

5401-
/* It's not possible punch hole on append only file */
5402-
if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) {
5403-
ret = -EPERM;
5404-
goto out_mutex;
5405-
}
5406-
54075401
if (IS_SWAPFILE(inode)) {
54085402
ret = -ETXTBSY;
54095403
goto out_mutex;

fs/ext4/inode.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3541,11 +3541,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
35413541
}
35423542

35433543
mutex_lock(&inode->i_mutex);
3544-
/* It's not possible punch hole on append only file */
3545-
if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) {
3546-
ret = -EPERM;
3547-
goto out_mutex;
3548-
}
3544+
35493545
if (IS_SWAPFILE(inode)) {
35503546
ret = -ETXTBSY;
35513547
goto out_mutex;

0 commit comments

Comments
 (0)