public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "Arkadiusz Miśkiewicz" <arekm@maven.pl>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] libfrog: pass correct structure to FS_IOC_FSSETXATTR
Date: Thu, 4 Dec 2025 13:11:05 -0800	[thread overview]
Message-ID: <20251204211105.GL89472@frogsfrogsfrogs> (raw)
In-Reply-To: <20251204192827.2371839-1-arekm@maven.pl>

On Thu, Dec 04, 2025 at 08:28:27PM +0100, Arkadiusz Miśkiewicz wrote:
> Commit 56af42ac ("libfrog: add wrappers for file_getattr/file_setattr syscalls")
> introduced the xfrog_file_setattr() framework, which was then wired up for
> xfs_quota in 961e42e0.
> 
> However, the wrong structure is passed to FS_IOC_FSSETXATTR, which breaks the
> xfs_quota "project" subcommand:
> 
>     # LC_ALL=C /usr/sbin/xfs_quota -x -c 'project -s -p /home/xxx 389701' /home
>     Setting up project 389701 (path /home/xxx)...
>     xfs_quota: cannot set project on /home/xxx: Invalid argument
>     Processed 1 (/etc/projects and cmdline) paths for project 389701 with recursion depth infinite (-1).
> 
> strace:
>     ioctl(5, FS_IOC_FSSETXATTR,
>           {fsx_xflags=FS_XFLAG_PROJINHERIT|FS_XFLAG_HASATTR,
>            fsx_extsize=0, fsx_projid=0, fsx_cowextsize=389701}) = -1 EINVAL (Invalid argument)
> 
> Fix the call to pass the correct structure so that the project ID is set
> properly.
> 
> Fixes: 56af42ac ("libfrog: add wrappers for file_getattr/file_setattr syscalls")
> Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>

That's correct, thanks for the fix patch.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

I'm kinda surprised gcc didn't warn about the set-but-unused variable.
Maybe the call to file_attr_to_fsxattr confused it or something.

> ---
>  libfrog/file_attr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> Note: the tests need to be updated, as they didn’t catch this problem.

Yep. :/

--D

> diff --git a/libfrog/file_attr.c b/libfrog/file_attr.c
> index c2cbcb4e..6801c545 100644
> --- a/libfrog/file_attr.c
> +++ b/libfrog/file_attr.c
> @@ -114,7 +114,7 @@ xfrog_file_setattr(
>  
>  	file_attr_to_fsxattr(fa, &fsxa);
>  
> -	error = ioctl(fd, FS_IOC_FSSETXATTR, fa);
> +	error = ioctl(fd, FS_IOC_FSSETXATTR, &fsxa);
>  	close(fd);
>  
>  	return error;
> -- 
> 2.52.0
> 
> 

  reply	other threads:[~2025-12-04 21:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 15:14 Tests for file_getattr()/file_setattr() and xfsprogs update Andrey Albershteyn
2025-08-27 15:15 ` [PATCH v2 0/4] xfsprogs: utilize file_getattr() and file_setattr() Andrey Albershteyn
2025-08-27 15:15   ` [PATCH v2 1/4] libfrog: add wrappers for file_getattr/file_setattr syscalls Andrey Albershteyn
2025-08-28 14:34     ` Darrick J. Wong
2025-12-02 15:37     ` Arkadiusz Miśkiewicz
2025-12-03  6:25       ` Christoph Hellwig
2025-12-03  9:31         ` Andrey Albershteyn
2025-12-04 19:28         ` [PATCH] libfrog: pass correct structure to FS_IOC_FSSETXATTR Arkadiusz Miśkiewicz
2025-12-04 21:11           ` Darrick J. Wong [this message]
2025-12-05  8:57           ` Christoph Hellwig
2025-08-27 15:15   ` [PATCH v2 2/4] xfs_quota: utilize file_setattr to set prjid on special files Andrey Albershteyn
2025-08-28 14:39     ` Darrick J. Wong
2025-08-29 15:42       ` Andrey Albershteyn
2025-08-27 15:15   ` [PATCH v2 3/4] xfs_io: make ls/chattr work with " Andrey Albershteyn
2025-08-28 14:40     ` Darrick J. Wong
2025-08-27 15:15   ` [PATCH v2 4/4] xfs_db: use file_setattr to copy attributes on special files with rdump Andrey Albershteyn
2025-08-28 14:41     ` Darrick J. Wong
2025-08-27 15:16 ` [PATCH v2 0/3] Test file_getattr and file_setattr syscalls Andrey Albershteyn
2025-08-27 15:16   ` [PATCH v2 1/3] file_attr: introduce program to set/get fsxattr Andrey Albershteyn
2025-08-28 14:49     ` Darrick J. Wong
2025-08-27 15:16   ` [PATCH v2 2/3] generic: introduce test to test file_getattr/file_setattr syscalls Andrey Albershteyn
2025-08-28 14:50     ` Darrick J. Wong
2025-08-27 15:16   ` [PATCH v2 3/3] xfs: test quota's project ID on special files Andrey Albershteyn
2025-08-28 14:51     ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251204211105.GL89472@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=arekm@maven.pl \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox