Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3468934imm; Tue, 29 May 2018 07:47:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqBT1uGe7M23vSXH5/rjKTfTOlI3/Fc4db8a6HOLrAisMWVUmL5yMNOWQPTBU0T50Er0omy X-Received: by 2002:a62:568f:: with SMTP id h15-v6mr17717044pfj.131.1527605236773; Tue, 29 May 2018 07:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527605236; cv=none; d=google.com; s=arc-20160816; b=xIXFVpQxuRZEcxyOW3iq8UDxKFw9u1g/AgfMYZS3WXTbLPYiOl7LQHMhTIYFpeTuMs tltepWTdY8bjaLPB26duA1LW8wrSUhnEx4gR8U/hsFY+125kME/4Ut/+Gm2oWW8KO0U8 Ey/OiTLqnyuneUtpEWOVjkS/xXXSpb6gZtsjP8bkUJRB6d0QAFJHQ11DTBvN/AYv5v8I w+BayVUhnM+AV+Uc/9K3UYXvwlFyYYcMPhAvCRsxwDsUzVCJzo8JAasvIy8QKJEfB4ba 9ae9qpySamfq3zMlx/DvU4yscB961LDr6exRxZ9uE/lmqjfguxHGdFT2fTVP6yLaOtUz sNLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=vovLDwXz27+6KKZZcXkAH/eHQ6My+HE+pn5Y+K3fCdw=; b=RLiVw26sHNgvz5FaN7OLhBOfhJkeZ7mlX3leDOAB3bwnPpbBp7GlUTShfjs9tNr9L3 jvJ9dG8M6+V2cEajdoZYA+8OHb+f3q0bBppFzSGA3mvRnYK9UvYyDN86U5NIZKPvUqlA Ej79s6qnAeHKuhTcrtf7sBUfzNR9mGNIoMXIzsppUwBBthV9pvh1nR6rKo3UhxmBK55W KRYUsFtPqcqwnv4aY/swahcxOlYoutngU/bVu+sjxPCJmnai+kjs7vkdnrCk9/YIAWth vLw/d7ZL+mpXtuUR2/3PMxkFijO5LL2eICmTWcSNzBmQUtXEYKB2qTlwkavQXBh2UD/4 X5Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4-v6si32511577plp.219.2018.05.29.07.47.02; Tue, 29 May 2018 07:47:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936474AbeE2Oo5 (ORCPT + 99 others); Tue, 29 May 2018 10:44:57 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:40108 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935402AbeE2OoR (ORCPT ); Tue, 29 May 2018 10:44:17 -0400 Received: by mail-wr0-f194.google.com with SMTP id l41-v6so26012223wre.7 for ; Tue, 29 May 2018 07:44:17 -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=vovLDwXz27+6KKZZcXkAH/eHQ6My+HE+pn5Y+K3fCdw=; b=no2fBO1/0Gi6BoNT4Ed7IpD0DIT5FqGuFyjdmqy1IaGLlz98qY809jH4J+otSQp2nn ezu8/14YNaP0neLLZDh2x1/smBjr9g7ggekEu/22xpS1IzU0lQB/xSH36LdmClYIJcCV PSJw+RfGW9R/b63ZMOY2l9t46JU6kb2ldF4JYU4sASO+KKg5/pgjsDswMvoAydX0GnIQ zNgtqrEMo99m1nmlA6BUgZezeu4WeueRU6/VsfJ8n8h0rQrS80S3rQPkfqpD5kqwUoWI vdAy+R8Ewbr8/nLxehLCdV/6xE0uq0iUO+fz7XE8BMzm5ZRt2NFfwvS/GqDNb2DoD4JZ eoRg== X-Gm-Message-State: ALKqPwdAU33wrj987hmQkpFrwsESuDeVWZKNWuWoqKNQvUgCpRbMTNrI OAcKxLpz+9OTwOQwym+34W/Lrg== X-Received: by 2002:adf:c98c:: with SMTP id f12-v6mr14962045wrh.272.1527605056001; Tue, 29 May 2018 07:44:16 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id t198-v6sm18834422wmt.23.2018.05.29.07.44.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:44:15 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 28/39] ovl: fix documentation of non-standard behavior Date: Tue, 29 May 2018 16:43:28 +0200 Message-Id: <20180529144339.16538-29-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529144339.16538-1-mszeredi@redhat.com> References: <20180529144339.16538-1-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 72615a2c0752..f087bc40c6a5 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 -- 2.14.3