From patchwork Sun Jan 31 13:22:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 8174411 Return-Path: X-Original-To: patchwork-linux-fsdevel@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 13F4DBEEE5 for ; Sun, 31 Jan 2016 13:22:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 441FA20320 for ; Sun, 31 Jan 2016 13:22:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62C10202FE for ; Sun, 31 Jan 2016 13:22:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932748AbcAaNWg (ORCPT ); Sun, 31 Jan 2016 08:22:36 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:34589 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932149AbcAaNWe (ORCPT ); Sun, 31 Jan 2016 08:22:34 -0500 Received: by mail-lf0-f53.google.com with SMTP id j78so11514702lfb.1; Sun, 31 Jan 2016 05:22:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=lgT1bEHfNI/O2EZYURdMdMdllt3rhmxH+XpXomteuRQ=; b=POHtqd2hfILj/1rU+XRlT/xLnblLYjdCZd1/BDn6I0oBk3H/trh2MZNx4z1MGHlILC 7lI7vg9AQWDbWfffvxoqnQDZ75tZvYUph/Z9AEcIo+Z71gNTyY4eyqJlHbGaChcYh3bU gqsO1Lefn45X8lTf3xQmXBDq58R4h1IHKCTLNYV2KOMpfz6dYXsMH/jH1qZ797SfflRZ VVl5drLSGNnLcNlSbsbfYQEHLdCLNv20RDP71AJeAp5al6sJPhxJ6ILpn9+R0h2GiC/t gl/FjxMVFUKm3P3j+l2ARL7E5fO1N/QDZHFYrzP3IHfSf7gg6ghd7hQ98l2g2gBubb55 SusQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:from:to:cc:date:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=lgT1bEHfNI/O2EZYURdMdMdllt3rhmxH+XpXomteuRQ=; b=mFXNJO+miWkDopFk/wYOGgV1T3ydcXPRX+aRyedOAFiGRr3DV2C1TMxOkCPUMK4sQc NubJRjKLcVC/0WoB895+MIlFfxbjWzh5K0EhPj42d27fvsS5Z7In8QybNuIUryemwdN5 PYITo0ED44yoiR42AcoFiXmRZskEERYmW4DMm+whHWWwIbYhMwrH89wM6ZYjnGh84YxJ UtoDd5wSjiK+9e4oz0ZxLMAXmznWp/F2A6nFYz9MHWfrwDbWmPDLP1WBeg3af3L6aiq4 dqh9gpiOL36UVfk0JFAnC7q+90+JfVjnefVlsEXxi0YZ7MTMTTBYK8mPgsr9zNZZvhAy hcfg== X-Gm-Message-State: AG10YORDxDZAuG7N4+RZhbIU8k58kG1GcEttjxsr73TF+mg/Semzr6fd5qtWtya9f3Mczw== X-Received: by 10.25.208.213 with SMTP id h204mr7000585lfg.112.1454246553068; Sun, 31 Jan 2016 05:22:33 -0800 (PST) Received: from localhost (ppp79-139-147-94.pppoe.spdop.ru. [79.139.147.94]) by smtp.gmail.com with ESMTPSA id ke9sm3276835lbc.28.2016.01.31.05.22.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Jan 2016 05:22:31 -0800 (PST) Subject: [PATCH] ovl: detect distributed fs also by looking into default dentry operations From: Konstantin Khlebnikov To: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Miklos Szeredi Cc: linux-kernel@vger.kernel.org, Alexander Viro Date: Sun, 31 Jan 2016 16:22:27 +0300 Message-ID: <145424654711.10854.12396689961212056269.stgit@zurg> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 For example fuse root dentry has no dentry operations. Signed-off-by: Konstantin Khlebnikov Fixes: 7c03b5d45b8e ("ovl: allow distributed fs as lower layer") --- fs/overlayfs/super.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 1a354840f262..7a236865d56c 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -365,6 +365,14 @@ static bool ovl_dentry_remote(struct dentry *dentry) (DCACHE_OP_REVALIDATE | DCACHE_OP_WEAK_REVALIDATE); } +static bool ovl_path_remote(const struct path *path) +{ + const struct dentry_operations *d_op = path->dentry->d_sb->s_d_op; + + return ovl_dentry_remote(path->dentry) || + (d_op && (d_op->d_revalidate || d_op->d_weak_revalidate)); +} + static bool ovl_dentry_weird(struct dentry *dentry) { return dentry->d_flags & (DCACHE_NEED_AUTOMOUNT | @@ -837,7 +845,7 @@ static int ovl_mount_dir(const char *name, struct path *path) err = ovl_mount_dir_noesc(tmp, path); if (!err) - if (ovl_dentry_remote(path->dentry)) { + if (ovl_path_remote(path)) { pr_err("overlayfs: filesystem on '%s' not supported as upperdir\n", tmp); path_put(path); @@ -866,7 +874,7 @@ static int ovl_lower_dir(const char *name, struct path *path, long *namelen, *namelen = max(*namelen, statfs.f_namelen); *stack_depth = max(*stack_depth, path->mnt->mnt_sb->s_stack_depth); - if (ovl_dentry_remote(path->dentry)) + if (ovl_path_remote(path)) *remote = true; return 0;