All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <marcos@mpdesouza.com>
To: dsterba@suse.cz, dsterba@suse.com, linux-btrfs@vger.kernel.org,
	wqu@suse.com, Marcos Paulo de Souza <mpdesouza@suse.com>
Subject: Re: [PATCHv2] progs: mkfs-tests: Skip test if truncate failed with EFBIG
Date: Mon, 2 Mar 2020 17:30:06 -0300	[thread overview]
Message-ID: <20200302203006.GA22707@hephaestus> (raw)
In-Reply-To: <20200302200716.GW2902@twin.jikos.cz>

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

On Mon, Mar 02, 2020 at 09:07:16PM +0100, David Sterba wrote:
> On Mon, Feb 24, 2020 at 03:05:34PM -0300, Marcos Paulo de Souza wrote:
> > From: Marcos Paulo de Souza <mpdesouza@suse.com>
> > 
> > The truncate command can fail in some platforms like PPC32[1] because it
> > can't create files up to 6E in size. Skip the test if this was the
> > problem why truncate failed.
> > 
> > [1]: https://github.com/kdave/btrfs-progs/issues/192
> 
> Issue: #192

David, can you please drop this patch and use the attached one instead? This one
has been tested by the user who reported the issue in bug 192.

Thanks,
  Marcos
> 
> > Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> 
> Added to devel, thanks.

[-- Attachment #2: 0001-progs-mkfs-tests-Skip-test-if-truncate-failed-with-E.patch --]
[-- Type: text/x-patch, Size: 1488 bytes --]

From 52b96ac75c2f8876f1ed9424cef92a4557306009 Mon Sep 17 00:00:00 2001
From: Marcos Paulo de Souza <mpdesouza@suse.com>
Date: Sat, 15 Feb 2020 19:47:12 -0300
Subject: [PATCH] progs: mkfs-tests: Skip test if truncate failed with EFBIG

The truncate command can fail in some platform like PPC32[1] because it
can't create files up to 6E in size. Skip the test if this was the
problem why truncate failed.

[1]: https://github.com/kdave/btrfs-progs/issues/192

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
 tests/mkfs-tests/018-multidevice-overflow/test.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/mkfs-tests/018-multidevice-overflow/test.sh b/tests/mkfs-tests/018-multidevice-overflow/test.sh
index 6c2f4dba..b8e2b18d 100755
--- a/tests/mkfs-tests/018-multidevice-overflow/test.sh
+++ b/tests/mkfs-tests/018-multidevice-overflow/test.sh
@@ -14,7 +14,17 @@ prepare_test_dev
 run_check_mkfs_test_dev
 run_check_mount_test_dev
 
-run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img1"
+# truncate can fail with EFBIG if the OS cannot created a 6E file
+stdout=$($SUDO_HELPER truncate -s 6E "$TEST_MNT/img1" 2>&1)
+ret=$?
+
+if [ $ret -ne 0 ]; then
+	if [[ "$stdout" == *"File too large"* ]]; then
+		_not_run "Current kernel could not create a 6E file"
+	fi
+	_fail "Truncate command failed: $ret"
+fi
+
 run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img2"
 run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img3"
 
-- 
2.25.0


  reply	other threads:[~2020-03-02 20:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 18:05 [PATCHv2] progs: mkfs-tests: Skip test if truncate failed with EFBIG Marcos Paulo de Souza
2020-03-02 20:07 ` David Sterba
2020-03-02 20:30   ` Marcos Paulo de Souza [this message]
2020-03-02 20:36     ` David Sterba
2020-03-06  3:39       ` Marcos Paulo de Souza
2020-03-19 15:03         ` Marcos Paulo de Souza

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=20200302203006.GA22707@hephaestus \
    --to=marcos@mpdesouza.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mpdesouza@suse.com \
    --cc=wqu@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.