From 6d387f64127ddb42d7b75ada390b0dd78b69dd38 Mon Sep 17 00:00:00 2001 From: dean gaudet Date: Fri, 3 Feb 2006 03:04:30 -0800 Subject: [PATCH] --- yaml --- r: 19661 b: refs/heads/master c: 7d95c8f27d9be65bf160f1edaf653d33dfceb58c h: refs/heads/master i: 19659: cbec9397a70d22baec183b1d08a1b078a7b1c67c v: v3 --- [refs] | 2 +- trunk/fs/fcntl.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 773582613d6b..35a70171638c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8b3e09e19932835fb77c63aaf3b1af6117e78871 +refs/heads/master: 7d95c8f27d9be65bf160f1edaf653d33dfceb58c diff --git a/trunk/fs/fcntl.c b/trunk/fs/fcntl.c index 5f96786d1c73..dc4a7007f4e7 100644 --- a/trunk/fs/fcntl.c +++ b/trunk/fs/fcntl.c @@ -208,8 +208,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg) struct inode * inode = filp->f_dentry->d_inode; int error = 0; - /* O_APPEND cannot be cleared if the file is marked as append-only */ - if (!(arg & O_APPEND) && IS_APPEND(inode)) + /* + * O_APPEND cannot be cleared if the file is marked as append-only + * and the file is open for write. + */ + if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode)) return -EPERM; /* O_NOATIME can only be set by the owner or superuser */