X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fopen.c;h=b47aab39c0572242c607495c37c15928fbf8290c;hb=HEAD;hp=5a2c6ebc22b5d9a1e355050cb14d3218f7a9d0d3;hpb=5fb24b8109e0cb343cc89cb148a836d490caa456;p=mv-sheeva.git diff --git a/fs/open.c b/fs/open.c index 5a2c6ebc22b..b47aab39c05 100644 --- a/fs/open.c +++ b/fs/open.c @@ -233,6 +233,14 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) if (!(file->f_mode & FMODE_WRITE)) return -EBADF; + + /* It's not possible punch hole on append only file */ + 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.