All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH] src/fiemap-tester: check for illegal block size
Date: Thu, 11 Oct 2018 14:45:22 +0300	[thread overview]
Message-ID: <20181011114522.7537-1-amir73il@gmail.com> (raw)

There was a regression in v4.19-rc1 that caused FIGETBSZ ioctl
to return 0 on an overlayfs file.

That regression went unnoticed because the xfstests that run
fiemap-tester program terminated in success status after not doing
much instead of failing.

Check for invalid value of block size returned by FIGETBSZ ioctl,
so these tests can detect the regression.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 src/fiemap-tester.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/fiemap-tester.c b/src/fiemap-tester.c
index 97ac5ad0..5b0af478 100644
--- a/src/fiemap-tester.c
+++ b/src/fiemap-tester.c
@@ -561,6 +561,12 @@ main(int argc, char **argv)
 		exit(1);
 	}
 
+	if (blocksize <= 0) {
+		printf("Illegal filesystem block size\n");
+		close(fd);
+		exit(1);
+	}
+
 #ifdef HAVE_FALLOCATE
 	/* if fallocate passes, then we can do preallocation, else not */
 	if (prealloc) {
-- 
2.17.1

                 reply	other threads:[~2018-10-11 11:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20181011114522.7537-1-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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.