public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiong Zhou <xzhou@redhat.com>
To: eguan@redhat.com
Cc: fstests@vger.kernel.org, Xiong Zhou <xzhou@redhat.com>
Subject: [PATCH v2] overlay: notrun if upper fs does not support d_type
Date: Fri, 22 Apr 2016 17:21:51 +0800	[thread overview]
Message-ID: <1461316911-17533-1-git-send-email-xzhou@redhat.com> (raw)
In-Reply-To: <1461312715-14197-2-git-send-email-xzhou@redhat.com>

Overlayfs whiteout can be visible if underlying upper fs does not
support d_type. Kernel commit
	45aebea (ovl: Ensure upper filesystem supports d_type)
prevents mounting overlayfs like this since v4.6-rc1.

Check upper fs before mounting overlay, mark as not run if needs.

Signed-off-by: Xiong Zhou <xzhou@redhat.com>
---

v2: use case to make this less ugly..


 common/rc | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/common/rc b/common/rc
index 8bec836..946b354 100644
--- a/common/rc
+++ b/common/rc
@@ -273,6 +273,22 @@ _overlay_mount()
 	local dir=$1
 	local mnt=$2
 	shift 2
+
+	local upper_fst=$(df --output=fstype $dir | tail -1)
+	case "$upper_fst" in
+	xfs)
+		if ! xfs_info $dir | grep -q "ftype=1" ; then
+			_notrun "upper fs needs to support d_type"
+		fi
+		;;
+	ext2|ext3|ext4)
+		if ! tune2fs -l $(df --output=source $dir | tail -1) | \
+		   grep -q filetype ; then
+			_notrun "upper fs needs to support d_type"
+		fi
+		;;
+	esac
+
 	mkdir -p $dir/$OVERLAY_UPPER_DIR
 	mkdir -p $dir/$OVERLAY_LOWER_DIR
 	mkdir -p $dir/$OVERLAY_WORK_DIR
-- 
2.5.5


  reply	other threads:[~2016-04-22  9:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21 12:23 [PATCH] overlay: test basic whiteout Xiong Zhou
2016-04-21 12:57 ` Eryu Guan
2016-04-21 13:15   ` Xiong Zhou
2016-04-22  8:11   ` [PATCH 1/2] " Xiong Zhou
2016-04-22  8:11     ` [PATCH 2/2] overlay: notrun if upper fs does not support d_type Xiong Zhou
2016-04-22  9:21       ` Xiong Zhou [this message]
2016-04-22 10:24         ` [PATCH v2] " Eryu Guan
2016-04-22 10:09     ` [PATCH 1/2] overlay: test basic whiteout Eryu Guan
2016-05-04  6:53 ` [PATCH] overlay: test copy up by changing mode bits Xiong Zhou
2016-05-04  9:26   ` Eryu Guan
2016-05-09  4:12 ` [PATCH] overlay: test memleak in copy up error handling path Xiong Zhou
2016-05-10  2:32   ` [PATCH v2] overlay: test memleak in copy-up " Xiong Zhou
2016-05-26  7:24     ` Eryu Guan
2016-05-27  5:46       ` Xiong Zhou

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=1461316911-17533-1-git-send-email-xzhou@redhat.com \
    --to=xzhou@redhat.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox