Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp144799pxb; Thu, 2 Sep 2021 21:57:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzybbIbjfU8X/dSu6kJFbzpByzer2h+Ho5xGDwNJZU42T339cIAvDCus2XJctGWJl97GcVc X-Received: by 2002:a92:6e12:: with SMTP id j18mr1300766ilc.243.1630645028946; Thu, 02 Sep 2021 21:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630645028; cv=none; d=google.com; s=arc-20160816; b=U/nbYKbe3KZCWiXVwX3MDfYcJ3LPYazJoBD/6pOb0rllydPb0ooSvS4TBWSIwY9Z8q nLuxPvEnx1nqBxYNA0+nyOUj02GPmGi0A6ZxJjVSHVRtLxjYlEfg2BXvu/WHPvA5mS4b 0gxWrQYvIA4AJ+EHi1Sb6Y2n2/tZMdGMHEfq2AjRyOpkOIVZIlDXWdYqutS0kelDORLI Ntz6hSnQJ82Orirjjs0b+ZTM2oW/gGsnp0k8bvuyYqWMIHGFGMVEGcrrkGctK5oNXkSn kb5KIosII08Lp1cE1I441QxHyPsRD2swGVUUKjzSbwJPjf4oRPkj5HaNbmv6kL3d+3Wt dJug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=EH4H9JPoxljLwSqnmx/5OifhpmHwxgQTci/vYJI2TPE=; b=ZFm5r/4wyCaSZW1ZH9LyMDR2VZVim+vaEug4b1pI5dt2u+Uu13I0vcIvWH4/HsZViw N7AIZjXeBhtcWnnAhwrZH4jfQK+rbeyleBqTOt60lwYXiy6mxQzcZqmlhsCPP/kAr+w6 J6Ms4watPPrv1F0p/A8IxbxzhBMQlQYaHnfMpk2RXWpcMn7+70Y2ap6rgZRKcB+A3tqI x/hz7UwsnRFaBGarmcmgQNSbynDDKPDRGB7JjFsZ6otOohIxD9QN3g99wTN4PuSv3B9m btqxYmOjWJAhgGqyq477Eh9ZN5FPszOzAxtl8/O0t8iCwhKVqk9cga7k3OSXmzyVW3RQ WYJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q14si5274005ilo.128.2021.09.02.21.56.57; Thu, 02 Sep 2021 21:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232645AbhICE4f (ORCPT + 99 others); Fri, 3 Sep 2021 00:56:35 -0400 Received: from mail108.syd.optusnet.com.au ([211.29.132.59]:53882 "EHLO mail108.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbhICE4e (ORCPT ); Fri, 3 Sep 2021 00:56:34 -0400 Received: from dread.disaster.area (pa49-195-182-146.pa.nsw.optusnet.com.au [49.195.182.146]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id E598E1B70A0; Fri, 3 Sep 2021 14:55:26 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1mM1EX-0085qb-Da; Fri, 03 Sep 2021 14:55:21 +1000 Date: Fri, 3 Sep 2021 14:55:21 +1000 From: Dave Chinner To: Vivek Goyal Cc: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtio-fs@redhat.com, dwalsh@redhat.com, dgilbert@redhat.com, christian.brauner@ubuntu.com, casey.schaufler@intel.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, tytso@mit.edu, miklos@szeredi.hu, gscrivan@redhat.com, bfields@redhat.com, stephen.smalley.work@gmail.com, agruenba@redhat.com, viro@zeniv.linux.org.uk Subject: Re: [PATCH 3/1] xfstests: generic/062: Do not run on newer kernels Message-ID: <20210903045521.GD1756565@dread.disaster.area> References: <20210902152228.665959-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=YKPhNiOx c=1 sm=1 tr=0 a=QpfB3wCSrn/dqEBSktpwZQ==:117 a=QpfB3wCSrn/dqEBSktpwZQ==:17 a=kj9zAlcOel0A:10 a=7QKq2e-ADPsA:10 a=20KFwNOVAAAA:8 a=7-415B0cAAAA:8 a=-kbUXcvnShYF-Q782qsA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 02, 2021 at 11:47:31AM -0400, Vivek Goyal wrote: > > xfstests: generic/062: Do not run on newer kernels > > This test has been written with assumption that setting user.* xattrs will > fail on symlink and special files. When newer kernels support setting > user.* xattrs on symlink and special files, this test starts failing. > > Found it hard to change test in such a way that it works on both type of > kernels. Primary problem is 062.out file which hardcodes the output and > output will be different on old and new kernels. > > So instead, do not run this test if kernel is new and is expected to > exhibit new behavior. Next patch will create a new test and run that > test on new kernel. > > IOW, on old kernels run 062 and on new kernels run new test. > > This is a proposed patch. Will need to be fixed if corresponding > kernel changes are merged upstream. > > Signed-off-by: Vivek Goyal > --- > tests/generic/062 | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > Index: xfstests-dev/tests/generic/062 > =================================================================== > --- xfstests-dev.orig/tests/generic/062 2021-08-31 15:51:08.160307982 -0400 > +++ xfstests-dev/tests/generic/062 2021-08-31 16:27:41.678307982 -0400 > @@ -55,6 +55,26 @@ _require_attrs > _require_symlinks > _require_mknod > > +user_xattr_allowed() > +{ > + local kernel_version kernel_patchlevel > + > + kernel_version=`uname -r | awk -F. '{print $1}'` > + kernel_patchlevel=`uname -r | awk -F. '{print $2}'` > + > + # Kernel version 5.14 onwards allow user xattr on symlink/special files. > + [ $kernel_version -lt 5 ] && return 1 > + [ $kernel_patchlevel -lt 14 ] && return 1 > + return 0; > +} We don't do this because code changes get backported to random kernels and so the kernel release is not a reliable indicator of feature support. Probing the functionality is the only way to reliably detect what a kernel supports. That's what we don in all the _requires*() functions, which is what this should all be wrapped in. > +# Kernel version 5.14 onwards allow user xattr on symlink/special files. > +# Do not run this test on newer kernels. Instead run the new test > +# which has been written with the assumption that user.* xattr > +# will succeed on symlink and special files. > +user_xattr_allowed && _notrun "Kernel allows user.* xattrs on symlinks and special files. Skipping this test. Run newer test instead." "run a newer test instead" is not a useful error message. Nor do you need "skipping this test" - that's exactly what "notrun" means. Cheers, Dave. -- Dave Chinner david@fromorbit.com