xfs
[Top] [All Lists]

Re: [PATCH] xfs: fix behaviour of XFS_IOC_FSSETXATTR on directories

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: fix behaviour of XFS_IOC_FSSETXATTR on directories
From: Iustin Pop <iustin@xxxxxxxxx>
Date: Fri, 5 Dec 2014 06:49:46 +0100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20141205001148.GS9561@dastard>
Mail-followup-to: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
References: <20140829004607.GX20518@dastard> <1417666466-31820-1-git-send-email-iustin@xxxxxxxxx> <20141205001148.GS9561@dastard>
User-agent: Mutt/1.5.23 (2014-03-12)
On Fri, Dec 05, 2014 at 11:11:48AM +1100, Dave Chinner wrote:
> On Thu, Dec 04, 2014 at 05:14:26AM +0100, Iustin Pop wrote:
> > Currently, the ioctl handling code for XFS_IOC_FSSETXATTR treats all
> > targets as regular files: it refuses to change the extent size if
> > extents are allocated. This is wrong for directories, as there the
> > extent size is only used as a default for children.
> > 
> > The patch fixes this issue and improves validation of flag
> > combinations:
> > 
> > - only disallow extent size changes after extents have been allocated
> >   for regular files
> > - only allow XFS_XFLAG_EXTSIZE for regular files
> > - only allow XFS_XFLAG_EXTSZINHERIT for directories
> > - automatically clear the flags if the extent size is zero
> > 
> > Thanks to Dave Chinner for guidance on the proper fix for this issue.
> 
> I'll have to remind myself of the context again - I think I have
> some patches in my local queue that I never finished that kill a lot
> of the mess around this code. I put that at the head of next week's
> queue...

Yep, I had forgotten myself what was the status, and had to reread
through the old email thread. That's what happens when you leave a patch
"rot" for so long :)

And yes, the code in this function is a bit hard to follow, since the
various checks are spread around. Cleaning this up would be good; I only
care that when next time I run an xfsrestore, it won't fail to set the
extent sizes correctly on directories :)

thanks!
iustin

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