Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751768AbdIOSfd (ORCPT ); Fri, 15 Sep 2017 14:35:33 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:53435 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbdIOSfb (ORCPT ); Fri, 15 Sep 2017 14:35:31 -0400 X-Google-Smtp-Source: AOwi7QDp1Yab65FruyQx53pD9QXWC0zDRvG9LS28VIrjQOLZjXwk4ANCfW0FdimmkbCPADtbrcaO6YV8aTmuygZHkBM= MIME-Version: 1.0 In-Reply-To: <20170915073226.GC19278@veci.piliscsaba.szeredi.hu> References: <20170913140528.GA19278@veci.piliscsaba.szeredi.hu> <20170915073226.GC19278@veci.piliscsaba.szeredi.hu> From: Linus Torvalds Date: Fri, 15 Sep 2017 11:35:25 -0700 X-Google-Sender-Auth: Vy7lcvaSHh1NTh4hBNJZt67hQSs Message-ID: Subject: Re: [GIT PULL] overlayfs update for 4.14 To: Miklos Szeredi Cc: Al Viro , Linux Kernel Mailing List , linux-fsdevel , "linux-unionfs@vger.kernel.org" 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: 1383 Lines: 32 On Fri, Sep 15, 2017 at 12:32 AM, Miklos Szeredi wrote: > > Fine. Here's a patch reverting the new flags and adding O_UPPER. Thanks, this patch looks fine to me, but now with the other discussion I think I'll leave the d_real() thing alone and see if Al has more comments about your other approach. Because it _would_ be even more lovely if we could just get rid of it entirely, and do all of this internally in ovlfs itself. > And we still have that issue with an fd opened for read-only and then > one opened for write, resulting in a copy-up, modification, and the > read-only fd still seeing the old data (union mounts had the same > issue, BTW). So we need more hacks or some way to have a shared page > cache that's breakable on copy up, which does not look trivial at all. Ugh, no, that's *very* non-trivial. I can see us doing magical things with the inode->i_mapping being an ovlfs-private mapping, and then sharing the actual physical pages with the mapping of the lower filesystem. So that way, the actual file data would never point directly at the lower filesystem. But equally obviously, that would *only* work when the lower filesystem is never modified directly. There may be other, even worse, issues with page sharing across mappings. So it might be a completely broken model, I haven't thought much about it. Linus