xfs
[Top] [All Lists]

Re: [PATCH 2/4] fs: Prevent doing FALLOC_FL_ZERO_RANGE on append only fi

To: LukÃÅ Czerner <lczerner@xxxxxxxxxx>
Subject: Re: [PATCH 2/4] fs: Prevent doing FALLOC_FL_ZERO_RANGE on append only file
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 16 Apr 2014 07:36:35 +1000
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <alpine.LFD.2.00.1404151457550.2146@xxxxxxxxxxxxxxxxxxxxx>
References: <1397242665-2183-1-git-send-email-lczerner@xxxxxxxxxx> <1397242665-2183-2-git-send-email-lczerner@xxxxxxxxxx> <20140412151935.GA18047@xxxxxxxxxxxxx> <alpine.LFD.2.00.1404151457550.2146@xxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Apr 15, 2014 at 03:09:42PM +0200, LukÃÅ Czerner wrote:
> On Sat, 12 Apr 2014, Christoph Hellwig wrote:
> 
> > Date: Sat, 12 Apr 2014 08:19:35 -0700
> > From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
> > To: Lukas Czerner <lczerner@xxxxxxxxxx>
> > Cc: linux-fsdevel@xxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx,
> >     linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
> > Subject: Re: [PATCH 2/4] fs: Prevent doing FALLOC_FL_ZERO_RANGE on append 
> > only
> >      file
> > 
> > On Fri, Apr 11, 2014 at 08:57:43PM +0200, Lukas Czerner wrote:
> > >   /*
> > > -  * It's not possible to punch hole or perform collapse range
> > > -  * on append only file
> > > +  * It's not possible to punch hole, perform collapse range
> > > +  * or zero range on append only file
> > >    */
> > > - if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE)
> > > + if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
> > > +             FALLOC_FL_ZERO_RANGE)
> > 
> > Might be better to make this a negative test fo the operation that is
> > allowed on an appen only file.  That's also much better future proof.
> > 
> 
> True, it might be better to do it this way:
> 
> if (mode & ~FALLOC_FL_KEEP_SIZE && IS_APPEND(inode))

if ((mode & ~FALLOC_FL_KEEP_SIZE) && IS_APPEND(inode))

:)

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>