On Wed, Nov 01, 2017 at 10:23:06PM -0700, Darrick J. Wong wrote: > On Thu, Nov 02, 2017 at 01:39:48AM +0100, Luis R. Rodriguez wrote: > > On Tue, Oct 31, 2017 at 03:43:20PM -0700, Darrick J. Wong wrote: > > > you shouldn't be able to set any DIFLAG/DIFLAG2 flags on special files. > > > > Do we know for certain *all* DIFLAG/DIFLAG2 flags can *only* be set via > > an ioctl()? > > I'm fairly sure that inode flags get set via ioctl, via inheritance at > creation time with only two exceptions*, but could you please take a look > at all the places we set inode di_flags/di_flags2 and report back? *users* can only set/clear inode flags through ioctls. The kernel can set/clear inode flags at any time, and they may be flags that users cannot change (e.g. the reflink flag, or the prealloc flag which is set during fallocate() calls to tell the kernel not to remove preallocations beyond EOF). Write up a set of masks that state what flags are valid on what type of inode. We can review that for correctness, then we can work out how to handle bad flags in repair... Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html