diff options
| author | Len Brown <len.brown@intel.com> | 2011-03-23 02:33:54 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2011-03-23 02:33:54 -0400 |
| commit | 5c129a8600100a5d0f5fdbc1014c5dba1d307bc4 (patch) | |
| tree | 9877a14b49cff43d0ba10c12f407ec551c77daa5 /fs/open.c | |
| parent | 797b10a07069e153d41aedb4ae8e76660279e2ee (diff) | |
| parent | 521cb40b0c44418a4fd36dc633f575813d59a43d (diff) | |
Merge commit 'v2.6.38' into release
Diffstat (limited to 'fs/open.c')
| -rw-r--r-- | fs/open.c | 8 |
1 files changed, 8 insertions, 0 deletions
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. |
