From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id pBMIFLFV177564 for ; Thu, 22 Dec 2011 12:15:21 -0600 Date: Thu, 22 Dec 2011 12:15:47 -0600 From: Ben Myers Subject: Re: [PATCH 1/2] xfs: clean up minor sparse warnings Message-ID: <20111222181547.GS29840@sgi.com> References: <1324426062-21505-1-git-send-email-david@fromorbit.com> <1324426062-21505-2-git-send-email-david@fromorbit.com> <20111221161349.GB7001@infradead.org> <20111221235904.GH23662@dastard> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20111221235904.GH23662@dastard> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Hey Dave, On Thu, Dec 22, 2011 at 10:59:04AM +1100, Dave Chinner wrote: > On Wed, Dec 21, 2011 at 11:13:50AM -0500, Christoph Hellwig wrote: > > > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > > > index d99a905..2f3f56a 100644 > > > --- a/fs/xfs/xfs_ioctl.c > > > +++ b/fs/xfs/xfs_ioctl.c > > > @@ -230,24 +230,22 @@ xfs_open_by_handle( > > > > > > /* Put open permission in namei format. */ > > > permflag = hreq->oflags; > > > - if ((permflag+1) & O_ACCMODE) > > > - permflag++; > > > if (permflag & O_TRUNC) > > > - permflag |= 2; > > > + permflag |= O_RDWR; > > > > > > if ((!(permflag & O_APPEND) || (permflag & O_TRUNC)) && > > > - (permflag & FMODE_WRITE) && IS_APPEND(inode)) { > > > + (OPEN_FMODE(permflag) & FMODE_WRITE) && IS_APPEND(inode)) { > > > error = -XFS_ERROR(EPERM); > > > goto out_dput; > > > } > > > > > > - if ((permflag & FMODE_WRITE) && IS_IMMUTABLE(inode)) { > > > + if ((OPEN_FMODE(permflag) & FMODE_WRITE) && IS_IMMUTABLE(inode)) { > > > error = -XFS_ERROR(EACCES); > > > goto out_dput; > > > } > > > > > > /* Can't write directories. */ > > > - if (S_ISDIR(inode->i_mode) && (permflag & FMODE_WRITE)) { > > > + if (S_ISDIR(inode->i_mode) && (OPEN_FMODE(permflag) & FMODE_WRITE)) { > > > error = -XFS_ERROR(EISDIR); > > > goto out_dput; > > > } > > > > I think this one is complicated enough that is deserves a separate > > patch and a better description. > > Ok, I've also just found a problem with it(*) so I'll separate it > and resend when I've fixed it. Reviewed-by: Ben Myers D'oh, I just reviewed this and didn't find the problem. Looking forward to your next rev to see what it is. -Ben _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs