On Fri, Jun 27, 2014 at 10:36:54AM -0500, Eric Sandeen wrote: > >> #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ > > > > Passing this bit directly via ioctl works as expected, but to my > > knowledge there is no chattr letter allocated for it. > > it's in the manpage, but as a read-only attribute, i.e. lsattr only.
Oh right, sorry. > >> and btrfs_ioctl_setflags claims to handle it: > >> > >> if (flags & FS_NOCOMP_FL) { > >> ip->flags &= ~BTRFS_INODE_COMPRESS; > >> ip->flags |= BTRFS_INODE_NOCOMPRESS; > >> ... > >> > >> so hopefully you can understand my confusion? ;) > > > > Oh I do now, but it's ext2 fault :) > > Ok but btrfs setflags tries to handle "FS_NOCOMP_FL" - how is that ever set? It handles the bit, but there's no friendly userspace tool for that, just the ioctl. > > AFAICS 'X' is not listed among the standard chattr options and chattr.c > > in e2fsprogs has no support for that. > > > > There is > > > > lib/e2p/pf.c: { EXT2_NOCOMPR_FL, "X", "Compression_Raw_Access" }, > > > > but this is used only locally by print_flags. > > Right, it's a "read-only" flag for lsattr. Got it. > > I hope this answers your questions, 'X' has no meaning for btrfs now. > > The only remaining question is, why does the btrfs setflags interface > try to parse it, if nothing sends it? It's allowed operation to manipulate the bit, I don't have anything better to say. > Or if something does send it, what? Lack of tool support, only via ioctl. > And where is this all documented? ;) Eww, sources? :) > btrfs tries to handle a flag value which is identical to the > 'X' flag value, which lsattr/chattr says is readonly... I'm looking at it from the kernel side, ie what's its meaning of the flag. The chattr tool still lives under the hood of e2fsprogs, but the ioctl interface is inherited to other filesystems (stating the obvious). e2fsprogs/chattr can decide to implement other meaning or new bits more or less freely (eg. there's the new 'N' flag for inlined files that I discovered just today while exploring the 'X' flag). There was a discussion at fsdevel about extending the interface or reworking it completely, I don't know if there's an outcome. >From the btrfs side, we have the object properties that make a nice interface for accessing the file attributes in parallel with the chattr tool. The interface is currently underused so it's not possible to manipulate the flags yet. I'd rather move the efforts to finalize this interface than adding single bits of the SETFLAGS ioctl and further extensions of the chattr/lsattr tools. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html