summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-12-01 04:02:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-12-01 04:02:08 +0000
commitfd095d09f2d475dc2e8599b1b8bae1cd65e91685 (patch)
tree217f87a997699505e0dd752931409b9f10fffe65 /fs/namei.c
parentc02e0599c4233f97071928f8118841954bacdadf (diff)
Merge with 2.1.56 as first part of merging back my code.
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 5aa6a5422..54714754d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -593,8 +593,12 @@ struct dentry * open_namei(const char * pathname, int flag, int mode)
* An append-only file must be opened in append mode for writing.
*/
error = -EPERM;
- if (IS_APPEND(inode) && ((flag & FMODE_WRITE) && !(flag & O_APPEND)))
- goto exit;
+ if (IS_APPEND(inode)) {
+ if ((flag & FMODE_WRITE) && !(flag & O_APPEND))
+ goto exit;
+ if (flag & O_TRUNC)
+ goto exit;
+ }
if (flag & O_TRUNC) {
error = get_write_access(inode);