Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934626AbcJUJaN (ORCPT ); Fri, 21 Oct 2016 05:30:13 -0400 Received: from mail-yw0-f172.google.com ([209.85.161.172]:34740 "EHLO mail-yw0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934524AbcJUJaG (ORCPT ); Fri, 21 Oct 2016 05:30:06 -0400 MIME-Version: 1.0 X-Originating-IP: [78.131.56.135] In-Reply-To: References: <20161012133326.GD31239@veci.piliscsaba.szeredi.hu> <20161020204630.GA1000@redhat.com> From: Miklos Szeredi Date: Fri, 21 Oct 2016 11:30:04 +0200 Message-ID: Subject: Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up To: Amir Goldstein Cc: Vivek Goyal , "linux-unionfs@vger.kernel.org" , linux-fsdevel , linux-kernel , Jeremy Eder , David Howells , Gou Rao , Vinod Jayaraman , Al Viro , Dave Chinner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 993 Lines: 26 On Fri, Oct 21, 2016 at 11:13 AM, Amir Goldstein wrote: > I think it would be a good idea in general to stabilize the overlay ino/dev > throughout copy-up, same as Miklos suggested to do for directories, to > all files: > pure upper uses upper ino + overlayfs dev > non-pure upper uses lower ino + overlayfs dev Making st_ino, st_dev and d_ino behave consistently would be the next big step. The above scheme only works if lower and upper are on the same filesystem. Otherwise there can be collisions between the lower and upper inode numbers. Perhaps you meant: - pure upper uses upper ino + upper dev - non-pure upper uses lower ino + overlayfs dev It works for the single lower layer case, but again breaks if there are multiple lower layers. And d_ino in a merged directory could still get us into trouble. And find -xdev would not do what you'd expect with a "normal" filesystem. So there doesn't appear to be any easy solutions to this... Thanks, Miklos