Re: [viro-vfs:work.xattr2] [fs/xattr] 64d47e878a: xfstests.xfs.046.fail

Oliver Sang <[email protected]>
Newsgroups gmane.linux.ports.ppc.embedded,gmane.linux.file-systems,gmane.linux.ports.alpha,gmane.linux.ports.arm.kernel,gmane.linux.kernel,gmane.linux.ports.mips,gmane.linux.ports.parisc,gmane.linux.ports.sh.devel,gmane.linux.ports.sparc,gmane.linux.kernel.api,gmane.linux.kernel.cross-arch
Message-ID <ZwaTvubyvE0cAj6P@xsang-OptiPlex-9020>
hi, Al Viro,

On Sun, Oct 06, 2024 at 03:59:04PM +0100, Al Viro wrote:
> On Sun, Oct 06, 2024 at 10:20:57PM +0800, kernel test robot wrote:
> 
> > xfs/046       - output mismatch (see /lkp/benchmarks/xfstests/results//xfs/046.out.bad)
> >     --- tests/xfs/046.out	2024-09-30 21:13:44.000000000 +0000
> >     +++ /lkp/benchmarks/xfstests/results//xfs/046.out.bad	2024-10-06 05:31:50.379495110 +0000
> >     @@ -34,4 +34,8 @@
> >      xfsrestore: restore complete: SECS seconds elapsed
> >      xfsrestore: Restore Status: SUCCESS
> >      Comparing listing of dump directory with restore directory
> >     +ls: /fs/scratch/dumpdir/sub/a-link: No such file or directory
> >     +ls: /fs/scratch/dumpdir/sub/b-link: No such file or directory
> >     +ls: /fs/scratch/restoredir/dumpdir/sub/a-link: No such file or directory
> >     +ls: /fs/scratch/restoredir/dumpdir/sub/b-link: No such file or directory
> >     ...
> >     (Run 'diff -u /lkp/benchmarks/xfstests/tests/xfs/046.out /lkp/benchmarks/xfstests/results//xfs/046.out.bad'  to see the entire diff)
> > Ran: xfs/046
> > Failures: xfs/046
> > Failed 1 of 1 tests
> 
> *stares*
> 
> D'oh...  Inverted sense for AT_SYMLINK_NOFOLLOW => LOOKUP_FLAGS...
> 
> Try this:

we confirm below patch can fix the issue

Tested-by: kernel test robot <[email protected]>

=========================================================================================
compiler/disk/fs/kconfig/rootfs/tbox_group/test/testcase:
  gcc-12/4HDD/xfs/x86_64-rhel-8.3-func/debian-12-x86_64-20240206.cgz/lkp-skl-d06/xfs-046/xfstests

commit:
  4b7d06e4b7a1c ("new helpers: file_removexattr(), filename_removexattr()")
  64d47e878a819 ("fs/xattr: add *at family syscalls")
  6f4ccbcfda377  <--- your patch

4b7d06e4b7a1c647 64d47e878a8196f374879bfdd0e 6f4ccbcfda377af1167d1b7fd48
---------------- --------------------------- ---------------------------
       fail:runs  %reproduction    fail:runs  %reproduction    fail:runs
           |             |             |             |             |
           :6          100%           6:6            0%            :10    xfstests.xfs.046.fail


> 
> diff --git a/fs/xattr.c b/fs/xattr.c
> index 0b506b6565b7..b96cca3f4bf8 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -721,7 +721,7 @@ static int path_setxattrat(int dfd, const char __user *pathname,
>  	if ((at_flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH)) != 0)
>  		return -EINVAL;
>  
> -	if (at_flags & AT_SYMLINK_NOFOLLOW)
> +	if (!(at_flags & AT_SYMLINK_NOFOLLOW))
>  		lookup_flags = LOOKUP_FOLLOW;
>  
>  	error = setxattr_copy(name, &ctx);
> @@ -880,7 +880,7 @@ static ssize_t path_getxattrat(int dfd, const char __user *pathname,
>  		return file_getxattr(fd_file(f), &ctx);
>  	} else {
>  		int lookup_flags = 0;
> -		if (at_flags & AT_SYMLINK_NOFOLLOW)
> +		if (!(at_flags & AT_SYMLINK_NOFOLLOW))
>  			lookup_flags = LOOKUP_FOLLOW;
>  		return filename_getxattr(dfd, filename, lookup_flags, &ctx);
>  	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.