From patchwork Fri Apr 22 08:11:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murphy Zhou X-Patchwork-Id: 8906821 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6FC7CBF29F for ; Fri, 22 Apr 2016 08:13:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A03A42025A for ; Fri, 22 Apr 2016 08:13:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C50372024F for ; Fri, 22 Apr 2016 08:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbcDVINq (ORCPT ); Fri, 22 Apr 2016 04:13:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751594AbcDVINo (ORCPT ); Fri, 22 Apr 2016 04:13:44 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7501710F1B8 for ; Fri, 22 Apr 2016 08:13:44 +0000 (UTC) Received: from localhost (dhcp-13-217.nay.redhat.com [10.66.13.217]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3M8DhUQ020900; Fri, 22 Apr 2016 04:13:43 -0400 From: Xiong Zhou To: eguan@redhat.com Cc: fstests@vger.kernel.org, Xiong Zhou Subject: [PATCH 2/2] overlay: notrun if upper fs does not support d_type Date: Fri, 22 Apr 2016 16:11:55 +0800 Message-Id: <1461312715-14197-2-git-send-email-xzhou@redhat.com> In-Reply-To: <1461312715-14197-1-git-send-email-xzhou@redhat.com> References: <20160421125732.GF4675@eguan.usersys.redhat.com> <1461312715-14197-1-git-send-email-xzhou@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 22 Apr 2016 08:13:44 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- common/rc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/rc b/common/rc index 8bec836..a25d30e 100644 --- a/common/rc +++ b/common/rc @@ -273,6 +273,18 @@ _overlay_mount() local dir=$1 local mnt=$2 shift 2 + + if [ "$(df --output=fstype $dir | tail -1)" == "xfs" ] && \ + ! xfs_info $dir | grep -q "ftype=1" ; then + _notrun "upper fs needs to support d_type" + fi + + if [[ "$(df --output=fstype $dir | tail -1)" =~ ext ]] && \ + ! tune2fs -l $(df --output=source $dir | tail -1) | \ + grep -q filetype ; then + _notrun "upper fs needs to support d_type" + fi + mkdir -p $dir/$OVERLAY_UPPER_DIR mkdir -p $dir/$OVERLAY_LOWER_DIR mkdir -p $dir/$OVERLAY_WORK_DIR