From patchwork Mon May 7 08:38:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8982160548 for ; Mon, 7 May 2018 08:40:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E94728A96 for ; Mon, 7 May 2018 08:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 733A328B3E; Mon, 7 May 2018 08:40:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1C1C28A96 for ; Mon, 7 May 2018 08:40:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbeEGIkq (ORCPT ); Mon, 7 May 2018 04:40:46 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39105 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752265AbeEGIix (ORCPT ); Mon, 7 May 2018 04:38:53 -0400 Received: by mail-wm0-f67.google.com with SMTP id f8-v6so13832855wmc.4 for ; Mon, 07 May 2018 01:38:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=td+UCIejA55cGIIycPwmWF8TMv5APeGbpivp6u5CX84=; b=YLGpFAARzuLw7bKYEswdxcgHLPBP7AsWKByB6bTkVP02cP28iAtPgyjyOZKaKMLJIc xZ/x+AVg5XqNnMHheejXszI3Z9dmiRN+SDKtGpHt9E8iFBx52igmJuVHdT3QhBS6277u vMcWA2V17dM09V0Z502RkY/3zQX6pGeS58VwNfF4LevFn0C++tRN02u9Ldelm6PJb1ib i1IKcrJCCME/VwnCbVr7gvgupTbe3Ma0VDT0mdQkQIiyJBJLdsl0THrerd+KfdYtjsTe ej2g9ZKjLapg58srUpkltA4KdHyyp3s3sJz3MM+mLUJ/uPq4SDF1OCsgq2Hr3xWwO3CT VqCw== X-Gm-Message-State: ALQs6tD7SCcReEMtcRAp+pM2oGlC7PTZrokX45+3LQx56BnWxxpDdpwu mfD+6Hr5qjykYzlz5y+Uu9hwGA== X-Google-Smtp-Source: AB8JxZrwwK8FrL20s0BzqOTvz0Di3rrUZGld6jnt1F7wI2bo1CBEVV++a3oUa3kGNBhg84zzhsmFeQ== X-Received: by 10.28.146.73 with SMTP id u70mr169038wmd.128.1525682332259; Mon, 07 May 2018 01:38:52 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:51 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 35/35] ovl: fix documentation of non-standard behavior Date: Mon, 7 May 2018 10:38:07 +0200 Message-Id: <20180507083807.28792-36-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We can now drop description of the ro/rw inconsistency from the documentation. Also clarify, that now fully standard compliant behavior can be enabled with kernel/module/mount options. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/overlayfs.txt | 60 +++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/Documentation/filesystems/overlayfs.txt b/Documentation/filesystems/overlayfs.txt index 961b287ef323..97eae826adf9 100644 --- a/Documentation/filesystems/overlayfs.txt +++ b/Documentation/filesystems/overlayfs.txt @@ -10,10 +10,6 @@ union-filesystems). An overlay-filesystem tries to present a filesystem which is the result over overlaying one filesystem on top of the other. -The result will inevitably fail to look exactly like a normal -filesystem for various technical reasons. The expectation is that -many use cases will be able to ignore these differences. - Overlay objects --------------- @@ -306,27 +302,49 @@ the copied layers will fail the verification of the lower root file handle. Non-standard behavior --------------------- -The copy_up operation essentially creates a new, identical file and -moves it over to the old name. Any open files referring to this inode -will access the old data. +Overlayfs can now act as a POSIX compliant filesystem with the following +features turned on: + +1) "redirect_dir" + +Enabled with the mount option or module option: "redirect_dir=on" or with +the kernel config option CONFIG_OVERLAY_FS_REDIRECT_DIR=y. + +If this feature is disabled, then rename(2) on a lower or merged directory +will fail with EXDEV ("Invalid cross-device link"). + +2) "inode index" + +Enabled with the mount option or module option "index=on" or with the +kernel config option CONFIG_OVERLAY_FS_INDEX=y. + +If this feature is disabled and a file with multiple hard links is copied +up, then this will "break" the link. Changes will not be propagated to +other names referring to the same inode. + +3) "xino" + +Enabled with the mount option "xino=auto" or "xino=on", with the module +option "xino_auto=on" or with the kernel config option +CONFIG_OVERLAY_FS_XINO_AUTO=y. Also implicitly enabled by using the same +underlying filesystem for all layers making up the overlay. -The new file may be on a different filesystem, so both st_dev and st_ino -of the real file may change. The values of st_dev and st_ino returned by -stat(2) on an overlay object are often not the same as the real file -stat(2) values to prevent the values from changing on copy_up. +If this feature is disabled or the underlying filesystem doesn't have +enough free bits in the inode number, then overlayfs will not be able to +guarantee that the values of st_ino and st_dev returned by stat(2) and the +value of d_ino returned by readdir(3) will act like on a normal filesystem. +E.g. the value of st_dev may be different for two objects in the same +overlay filesystem and the value of st_ino for directory objects may not be +persistent and could change even while the overlay filesystem is mounted. -Unless "xino" feature is enabled, when overlay layers are not all on the -same underlying filesystem, the value of st_dev may be different for two -non-directory objects in the same overlay filesystem and the value of -st_ino for directory objects may be non persistent and could change even -while the overlay filesystem is still mounted. +4) "copy_up_shared" -Unless "inode index" feature is enabled, if a file with multiple hard -links is copied up, then this will "break" the link. Changes will not be -propagated to other names referring to the same inode. +Enabled with the mount option or module option "copy_up_shared=on" or with +the kernel config option CONFIG_OVERLAY_FS_COPY_UP_SHARED=y. -Unless "redirect_dir" feature is enabled, rename(2) on a lower or merged -directory will fail with EXDEV. +If this feature is disabled, then a memory mapping created with MAP_SHARED +might contain stale data if the file has been copied up and modified in the +meantime. Changes to underlying filesystems