From patchwork Fri Apr 22 09:21:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murphy Zhou X-Patchwork-Id: 8907521 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 7BA18BF29F for ; Fri, 22 Apr 2016 09:22:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A06D52025A for ; Fri, 22 Apr 2016 09:22:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7160D2012B for ; Fri, 22 Apr 2016 09:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752283AbcDVJWR (ORCPT ); Fri, 22 Apr 2016 05:22:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55801 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbcDVJWQ (ORCPT ); Fri, 22 Apr 2016 05:22:16 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 0797862664 for ; Fri, 22 Apr 2016 09:22:16 +0000 (UTC) Received: from localhost (dhcp-13-217.nay.redhat.com [10.66.13.217]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3M9MEWK026121; Fri, 22 Apr 2016 05:22:15 -0400 From: Xiong Zhou To: eguan@redhat.com Cc: fstests@vger.kernel.org, Xiong Zhou Subject: [PATCH v2] overlay: notrun if upper fs does not support d_type Date: Fri, 22 Apr 2016 17:21:51 +0800 Message-Id: <1461316911-17533-1-git-send-email-xzhou@redhat.com> In-Reply-To: <1461312715-14197-2-git-send-email-xzhou@redhat.com> References: <1461312715-14197-2-git-send-email-xzhou@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 22 Apr 2016 09:22:16 +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 Reviewed-by: Eryu Guan --- 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