Received: by 10.192.165.156 with SMTP id m28csp2076040imm; Thu, 12 Apr 2018 08:13:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx48F09/s1qUViXOfSJlQKPwxvALcAbVE7G/lr1JNfEZJ1jKQvycy55xS9ie8fIRqIf4/XmHG X-Received: by 10.99.39.135 with SMTP id n129mr1009556pgn.167.1523546005892; Thu, 12 Apr 2018 08:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523546005; cv=none; d=google.com; s=arc-20160816; b=mPMyHK1aKjMqOM7SdYoel+/l5h3Lxag4zCOu3c9lCYua/hJdkM/mN2Mqj15jYcDUJa LLHLA7wILFBVOPMB4jl0+NgsEzuFBbMT4oKWSxVckcpoHSNeiyMs5WHGNazjBz8rrieO GwBl1Te7jgcC3OMYMZNAHBQsOz4D4H0ZQTPluqO3m9KvbT9+UKaBZb+kdjpbEotJsiw9 o1HxqG4owxCCXLsXcyArO5lzUSGwxtKyNgZKh07dRMKasKyRguJhGSS8LvT/4o9HTMz1 Zq6jm+Nf+NZtyEA1fYNyMMtOrPr1xLIqJQf5CcrC76aEx5hDmLvnfPfNmUrhV1yrIoaN Dwrg== 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=2zb9t90b16gHbTWNfEqSM1NfNVMzdj61lixBd5oltGc=; b=l7KCoZYFWiJYlgOc/iJJHO1fzJDhe2KaW5Z45Rb4RfTiOXI/vA+/vq/Od9FL3Q0NpZ o2InF18W7EoYUqWGMGSVvXrBJzgxfO+nw/o+sNSLY84QYmgLeSWtGQ0M39Dni+0evNEL lR45fQUJxmVUwfAdEjHsCH4tKt0OXwbJ3aOrLKOB6plaoAnATM3n+JAJHH1SDWWqeSOq T2LBeptl9ntJlhX/olxu+V3OZk8tBGix3+lILaZTILkBMC7EKrhWRHzLMlP1tgyjvBcA JTQ12LYH4QR8AE2RLndA9J67erkwrYypLiRqNrOd7W1qfFwUrMzrVyRzmn86ZWZmXJmA ouNA== 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 d23si2359812pgn.235.2018.04.12.08.12.49; Thu, 12 Apr 2018 08:13:25 -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 S1753838AbeDLPJa (ORCPT + 99 others); Thu, 12 Apr 2018 11:09:30 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:46501 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800AbeDLPJN (ORCPT ); Thu, 12 Apr 2018 11:09:13 -0400 Received: by mail-wr0-f193.google.com with SMTP id d1so5454427wrj.13 for ; Thu, 12 Apr 2018 08:09:13 -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=2zb9t90b16gHbTWNfEqSM1NfNVMzdj61lixBd5oltGc=; b=aG1s9RUAaOFnLZKZUBwPYNQuH1iEmo0Xpm2pO80Va3MtPaHEPVjREPsJoDWXcsxM84 tK+m6ljG5qelUa9xcvGvqb9AVyeYNPgc3DRh9NMllkd845lAQeIIfQeCkoNySXFiH98p LAHaxVT1SbtepDc3sZzS8xNvYszd8qx1l4A2r7M5fsO858d4u28Y4/in0CCXknFxaqJb E3eUs8Aqu0hlXegmm+1FQF1KSkRT+rOvCuLF2ODHENZkrMHP++E43NRO73yKB3u2jvnK HZGND46mJIRiGujOy2RNu0xjcDh3dPy3FaKEX+rxDGmtE7ofJ5nS0npd75kwNHRyMLkH BHLw== X-Gm-Message-State: ALQs6tDxLP+vt7taSpHAZkBLgF3CH79lenQr4gx4kdYodqGy6Sc54f79 MiWI669DSgQhyyXRPX3zR2HJMQ== X-Received: by 10.223.185.76 with SMTP id b12mr1112419wrg.205.1523545752529; Thu, 12 Apr 2018 08:09:12 -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 p197sm2621783wme.43.2018.04.12.08.09.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Apr 2018 08:09:11 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 35/35] ovl: fix documentation of non-standard behavior Date: Thu, 12 Apr 2018 17:08:26 +0200 Message-Id: <20180412150826.20988-36-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180412150826.20988-1-mszeredi@redhat.com> References: <20180412150826.20988-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 | 64 ++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/Documentation/filesystems/overlayfs.txt b/Documentation/filesystems/overlayfs.txt index 961b287ef323..095186080d23 100644 --- a/Documentation/filesystems/overlayfs.txt +++ b/Documentation/filesystems/overlayfs.txt @@ -306,27 +306,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. - -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. - -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. - -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. - -Unless "redirect_dir" feature is enabled, rename(2) on a lower or merged -directory will fail with EXDEV. +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. + +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. + +4) "copy_up_shared" + +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. + +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