All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfs: no need to check about IS_IMMUTABLE in do_fallocate
@ 2013-04-27  4:42 Ashish Sangwan
  2013-04-27  6:56 ` Marco Stornelli
  0 siblings, 1 reply; 3+ messages in thread
From: Ashish Sangwan @ 2013-04-27  4:42 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, Ashish Sangwan, Namjae Jeon

From: Ashish Sangwan <a.sangwan@samsung.com>

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.

Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
---
 fs/open.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 8c74100..939e402 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -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.
-- 
1.7.8.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-27 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-27  4:42 [PATCH] vfs: no need to check about IS_IMMUTABLE in do_fallocate Ashish Sangwan
2013-04-27  6:56 ` Marco Stornelli
2013-04-27 10:24   ` Ashish Sangwan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.