From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9E4DF1F852; Mon, 31 Jan 2022 02:03:11 +0000 (UTC) Date: Mon, 31 Jan 2022 02:03:11 +0000 From: Eric Wong To: Dominique Martinet Cc: Julien Moutinho , meta@public-inbox.org Subject: Re: [PATCH] nodatacow: quiet chattr errors [was: Test failures with 1.7.0] Message-ID: <20220131020311.M540193@dcvr> References: <20211208010730.f47xxgzj53nwgvja@sourcephile.fr> <20211208040836.GA27368@dcvr> <20211208182247.M197857@dcvr> <20220130214908.M320944@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: Dominique Martinet wrote: > Eric Wong wrote on Sun, Jan 30, 2022 at 09:49:08PM +0000: > > Thanks for testing the previous patch. Actually, I prefer we > > drop previous implementations and instead rely on Linux ABI > > stability while shifting maintenance burden to maintainers. > > This makes sense. > > > Can you test the patch below? It supercedes the other one. > > I've tested the patch with a btrfs test directory and this test: > BTRFS_TESTDIR=... prove -bvw t/nodatacow.t > > after adding the local git repo to PERL5LIBs > > With a BTRFS dir as BTRFS it all works, the ioctl are passed and files > are indeed nocow (checked with lsattr afterwards as files aren't > deleted) > > With a tmpfs instead the tests fail as it tried to call the ioctl > anyway -- I didn't take the time to check if thest mtab parsing was > removed, is the ioctl tried anyway or does setting the environment > variable skip this part? > If so then it's probably fine. > > (the failure is as below: > ------ > $ BTRFS_TESTDIR=/tmp/test strace -o /tmp/strace -f prove -bvw t/nodatacow.t > t/nodatacow.t .. > ok 1 - use PublicInbox::Syscall; > /run/current-system/sw/bin/lsattr: Operation not supported While reading flags on /tmp/test/nodatacow-rfqh/pp.f > not ok 2 - `C' attribute set on fd with pure Perl > > # Failed test '`C' attribute set on fd with pure Perl' > # at t/nodatacow.t line 31. > # '' > # doesn't match '(?^:C.*\/tmp\/test\/nodatacow\-rfqh\/pp\.f)' > /run/current-system/sw/bin/lsattr: Operation not supported While reading flags on /tmp/test/nodatacow-rfqh/pp.d Ah, intentionally setting BTRFS_TESTDIR to something that isn't btrfs will break, yes. I suppose an explicit BAIL_OUT is in order, here: diff --git a/t/nodatacow.t b/t/nodatacow.t index 83aa227f..0940d908 100644 --- a/t/nodatacow.t +++ b/t/nodatacow.t @@ -28,8 +28,9 @@ SKIP: { open my $fh, '>', $name or BAIL_OUT "open($name): $!"; PublicInbox::Syscall::nodatacow_fh($fh); my $res = xqx([$lsattr, $name]); - like($res, qr/C.*\Q$name\E/, "`C' attribute set on fd with pure Perl"); + BAIL_OUT "lsattr(1) fails in $dir" if $?; + like($res, qr/C.*\Q$name\E/, "`C' attribute set on fd with pure Perl"); $name = "$dn/pp.d"; mkdir($name) or BAIL_OUT "mkdir($name) $!";