Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754274AbbFEAHW (ORCPT ); Thu, 4 Jun 2015 20:07:22 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:56009 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754117AbbFEAHS (ORCPT ); Thu, 4 Jun 2015 20:07:18 -0400 Date: Fri, 5 Jun 2015 01:07:15 +0100 From: Al Viro To: Miklos Szeredi Cc: linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, sa-dev@rainbow.by, andre.roth@roche.com Subject: Re: [PATCH 2/2] ovl: allow distributed fs as lower layer Message-ID: <20150605000715.GP7232@ZenIV.linux.org.uk> References: <1433424586-7771-1-git-send-email-miklos@szeredi.hu> <1433424586-7771-3-git-send-email-miklos@szeredi.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433424586-7771-3-git-send-email-miklos@szeredi.hu> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1367 Lines: 34 On Thu, Jun 04, 2015 at 03:29:46PM +0200, Miklos Szeredi wrote: > From: Miklos Szeredi > > Allow filesystems with .d_revalidate as lower layer(s), but not as upper > layer. > > For local filesystems the rule was that modifications on the layers > directly while being part of the overlay results in undefined behavior. > > This can easily be extended to distributed filesystems: we assume the tree > used as lower layer is static, which means ->d_revalidate() should always > return "1". If that is not the case, return -ESTALE, don't try to work > around the modification. Umm... Cosmetical point is that this > +static bool ovl_remote(struct dentry *root) > +{ > + const struct dentry_operations *dop = root->d_op; > + > + return dop && (dop->d_revalidate || dop->d_weak_revalidate); > +} is better done as root->d_flags & (DCACHE_OP_REVALIDATE | DCACHE_OP_WEAK_REVALIDATE) More interesting question is whether anything in the system relies on existing behaviour that follows ->d_revalidate() returning 0. Have you tried to mount e.g. procfs as underlying layer and torture it for a while? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/