diff --git a/[refs] b/[refs] index 4f8437fdcd78..f7f5aea3efac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 991ac30d8b30ab6051dff5a7b07d84e6f5efa3a6 +refs/heads/master: 1ca551c6caae7b52178555cdedea6ca26444be46 diff --git a/trunk/fs/open.c b/trunk/fs/open.c index 5a2c6ebc22b5..b47aab39c057 100644 --- a/trunk/fs/open.c +++ b/trunk/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.