xfs
[Top] [All Lists]

Re: [PATCH 1/2] xfs: clean up minor sparse warnings

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/2] xfs: clean up minor sparse warnings
From: Ben Myers <bpm@xxxxxxx>
Date: Wed, 1 Feb 2012 12:33:40 -0600
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20111221235904.GH23662@dastard>
References: <1324426062-21505-1-git-send-email-david@xxxxxxxxxxxxx> <1324426062-21505-2-git-send-email-david@xxxxxxxxxxxxx> <20111221161349.GB7001@xxxxxxxxxxxxx> <20111221235904.GH23662@dastard>
User-agent: Mutt/1.5.18 (2008-05-17)
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.

Did you resend this?

Thanks,
Ben

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 1/2] xfs: clean up minor sparse warnings, Ben Myers <=