Message ID | 20250222150832.133343-1-ailiop@suse.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | xfs_io: don't fail FS_IOC_FSGETXATTR on filesystems that lack support | expand |
On Sat, Feb 22, 2025 at 04:08:32PM +0100, Anthony Iliopoulos wrote: > Not all filesystems implement the FS_IOC_FSGETXATTR ioctl, and in those > cases -ENOTTY will be returned. There is no need to return with an error > when this happens, so just silently return. > > Without this fstest generic/169 fails on NFS that doesn't implement the > fileattr_get inode operation. > > Fixes: e6b48f451a5d ("xfs_io: allow foreign FSes to show FS_IOC_FSGETXATTR details") > Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> oops yeah Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > --- > io/stat.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/io/stat.c b/io/stat.c > index 3ce3308d0562..d27f916800c0 100644 > --- a/io/stat.c > +++ b/io/stat.c > @@ -104,8 +104,10 @@ print_extended_info(int verbose) > struct fsxattr fsx = {}, fsxa = {}; > > if ((ioctl(file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { > - perror("FS_IOC_GETXATTR"); > - exitcode = 1; > + if (errno != ENOTTY) { > + perror("FS_IOC_FSGETXATTR"); > + exitcode = 1; > + } > return; > } > > -- > 2.47.0 > >
diff --git a/io/stat.c b/io/stat.c index 3ce3308d0562..d27f916800c0 100644 --- a/io/stat.c +++ b/io/stat.c @@ -104,8 +104,10 @@ print_extended_info(int verbose) struct fsxattr fsx = {}, fsxa = {}; if ((ioctl(file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { - perror("FS_IOC_GETXATTR"); - exitcode = 1; + if (errno != ENOTTY) { + perror("FS_IOC_FSGETXATTR"); + exitcode = 1; + } return; }
Not all filesystems implement the FS_IOC_FSGETXATTR ioctl, and in those cases -ENOTTY will be returned. There is no need to return with an error when this happens, so just silently return. Without this fstest generic/169 fails on NFS that doesn't implement the fileattr_get inode operation. Fixes: e6b48f451a5d ("xfs_io: allow foreign FSes to show FS_IOC_FSGETXATTR details") Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> --- io/stat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)