vfs: no need to check about IS_IMMUTABLE in do_fallocate
PATCH 1/1 vfs: no need to check about IS_IMMUTABLE in do_fallocate
From: Ashish Sangwan <[email protected]>
In do_fallocate, first there is check for FMODE_WRITE and after that there is second check for IS_IMMUTABLE.
A file cannot be opened in write mode if the corresponding inode is immutable, hence the second check is not required.
--- fs/open.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
fs/open.c +0 -3
@@ -245,9 +245,6 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)if (mode &FALLOC_FL_PUNCH_HOLE &&IS_APPEND (inode))return -EPERM ; -if (IS_IMMUTABLE (inode)) -return -EPERM ; -/* * Revalidate the write permissions, in case security policy has * changed since the files were opened.
Signature · 1 line
1.7.8.4
Il 27/04/2013 06:42, Ashish Sangwan ha scritto:
Quoted 9 lines
From: Ashish Sangwan <[email protected]>
In
do_fallocate, first there is check forFMODE_WRITEand after that there is second check forIS_IMMUTABLE.
A file cannot be opened in write mode if the corresponding inode is immutable, hence the second check is not required.Signed-off-by Ashish Sangwan <[email protected]>Signed-off-by Namjae Jeon <[email protected]>
See commit 1ca551c6caae7b52178555cdedea6ca26444be46.
Regards,
Marco
Quoted 9 lines · Marco Stornelli
Il 27/04/2013 06:42, Ashish Sangwan ha scritto:
Quoted 7 lines
From: Ashish Sangwan <[email protected]>
In
do_fallocate, first there is check forFMODE_WRITEand after that there is second check forIS_IMMUTABLE.
A file cannot be opened in write mode if the corresponding inode is immutable, hence the second check is not required.
Quoted 5 lines
Quoted 2 lines
Signed-off-by Ashish Sangwan <[email protected]>Signed-off-by Namjae Jeon <[email protected]>See commit
1ca551c6caae7b52178555cdedea6ca26444be46.
Got it,
Thanks,
Ashish
Quoted 4 lines
Regards,
Marco