Re: lsattr: incorrect size for ioctl result

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 29, 2021 at 02:04:22PM -0700, Darrick J. Wong wrote:
> 
> Why don't we deprecate FS_IOC_[GS]ETFLAGS and tell everyone to use
> FS[GS]ETXATTR?  They use the same code paths and vfs helpers now.

The FS_IOC_[GS]ETXATTR ioctls use struct fsxattr, which contains
fsx_xflags.  But there are flags returned (and set) by
FS_IOC_[GS]ETFLAGS that are not in fsx_xflags --- and vice versa, of
course.

That's not a problem for xfs, since fsx_xflags was originally designed
for xfs (and so it has some xfs-specific flags such as
FS_XFLAG_REALTIME, FS_XFLAG_RTINHERIT, FS_XFLAG_FILESTREAM,
FS_XFLAG_COWEXTSIZE, etc.).

But for other file systems, including btrfs, ext4 and f2fs, which
utilize FS_IOC_[GS]ETFLAGS flags which are not supported by
FS_IOC_[GS]ETXATTR's fsx_xflags.  Examples of such flags include
FS_ENCRYPT_FL, FS_TOPDIR_FL, FS_NOCMP_FL, and FS_CASEFOLD_FL.

There is also the _IO[RW] long vs int "API violation" for the
FS_IOC_[GS]ETVERSION which isn't addressed by FS_IOC_[GS]ETATTR.

So FS_IOC_[GS]ETATTR isn't a complete replacement/solution for these
"problem" ioctls.  And of course, even if we were to start telling
everyone to start using a new interface, it'll be many years before
any transition is complete.

						- Ted



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux