From: Andreas Gruenbacher Date: Fri, 6 Oct 2017 00:11:59 +0200 Subject: [Cluster-devel] [PATCH] gfs2: Remove incorrect permission check in gfs2_setattr Message-ID: <20171005221159.27255-1-agruenba@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Function notify_change already performs the necessary permission checks for immutable and append-only files, so there is no need to check again in setattr inode operations. What's worse, the check in gfs2_setattr prevents setting the atime and mtime of append-only files to the current time, which is supposed to be permitted. Fixes xfstest generic/079. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/inode.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 4749a6b8e4dd..05284dd2ae6c 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1940,10 +1940,6 @@ static int gfs2_setattr(struct dentry *dentry, struct iattr *attr) if (error) return error; - error = -EPERM; - if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) - goto out; - error = setattr_prepare(dentry, attr); if (error) goto out; -- 2.13.5