21 Apr, 2020

1 commit

  • Several references got broken due to txt to ReST conversion.

    Several of them can be automatically fixed with:

    scripts/documentation-file-ref-check --fix

    Reviewed-by: Mathieu Poirier # hwtracing/coresight/Kconfig
    Reviewed-by: Paul E. McKenney # memory-barrier.txt
    Acked-by: Alex Shi # translations/zh_CN
    Acked-by: Federico Vaga # translations/it_IT
    Acked-by: Marc Zyngier # kvm/arm64
    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/6f919ddb83a33b5f2a63b6b5f0575737bb2b36aa.1586881715.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

13 Mar, 2020

1 commit

  • Fix up two bugs in the coversion to xino_mode:
    1. xino=off does not always end up in disabled mode
    2. xino=auto on 32bit arch should end up in disabled mode

    Take a proactive approach to disabling xino on 32bit kernel:
    1. Disable XINO_AUTO config during build time
    2. Disable xino with a warning on mount time

    As a by product, xino=on on 32bit arch also ends up in disabled mode.
    We never intended to enable xino on 32bit arch and this will make the
    rest of the logic simpler.

    Fixes: 0f831ec85eda ("ovl: simplify ovl_same_sb() helper")
    Signed-off-by: Amir Goldstein
    Signed-off-by: Miklos Szeredi

    Amir Goldstein
     

21 May, 2019

1 commit


20 Jul, 2018

1 commit

  • By default metadata only copy up is disabled. Provide a mount option so
    that users can choose one way or other.

    Also provide a kernel config and module option to enable/disable metacopy
    feature.

    metacopy feature requires redirect_dir=on when upper is present.
    Otherwise, it requires redirect_dir=follow atleast.

    As of now, metacopy does not work with nfs_export=on. So if both
    metacopy=on and nfs_export=on then nfs_export is disabled.

    Signed-off-by: Vivek Goyal
    Reviewed-by: Amir Goldstein
    Signed-off-by: Miklos Szeredi

    Vivek Goyal
     

31 May, 2018

1 commit


12 Apr, 2018

1 commit

  • With mount option "xino=on", mounter declares that there are enough
    free high bits in underlying fs to hold the layer fsid.
    If overlayfs does encounter underlying inodes using the high xino
    bits reserved for layer fsid, a warning will be emitted and the original
    inode number will be used.

    The mount option name "xino" goes after a similar meaning mount option
    of aufs, but in overlayfs case, the mapping is stateless.

    An example for a use case of "xino=on" is when upper/lower is on an xfs
    filesystem. xfs uses 64bit inode numbers, but it currently never uses the
    upper 8bit for inode numbers exposed via stat(2) and that is not likely to
    change in the future without user opting-in for a new xfs feature. The
    actual number of unused upper bit is much larger and determined by the xfs
    filesystem geometry (64 - agno_log - agblklog - inopblog). That means
    that for all practical purpose, there are enough unused bits in xfs
    inode numbers for more than OVL_MAX_STACK unique fsid's.

    Another use case of "xino=on" is when upper/lower is on tmpfs. tmpfs inode
    numbers are allocated sequentially since boot, so they will practially
    never use the high inode number bits.

    For compatibility with applications that expect 32bit inodes, the feature
    can be disabled with "xino=off". The option "xino=auto" automatically
    detects underlying filesystem that use 32bit inodes and enables the
    feature. The Kconfig option OVERLAY_FS_XINO_AUTO and module parameter of
    the same name, determine if the default mode for overlayfs mount is
    "xino=auto" or "xino=off".

    Signed-off-by: Amir Goldstein
    Signed-off-by: Miklos Szeredi

    Amir Goldstein
     

07 Mar, 2018

1 commit

  • Add some hints about overlayfs kernel config options.

    Enabling NFS export by default is especially recommended against, as it
    incurs a performance penalty even if the filesystem is not actually
    exported.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     

24 Jan, 2018

2 commits

  • Introduce the "nfs_export" config, module and mount options.

    The NFS export feature depends on the "index" feature and enables two
    implicit overlayfs features: "index_all" and "verify_lower".
    The "index_all" feature creates an index on copy up of every file and
    directory. The "verify_lower" feature uses the full index to detect
    overlay filesystems inconsistencies on lookup, like redirect from
    multiple upper dirs to the same lower dir.

    NFS export can be enabled for non-upper mount with no index. However,
    because lower layer redirects cannot be verified with the index, enabling
    NFS export support on an overlay with no upper layer requires turning off
    redirect follow (e.g. "redirect_dir=nofollow").

    The full index may incur some overhead on mount time, especially when
    verifying that lower directory file handles are not stale.

    NFS export support, full index and consistency verification will be
    implemented by following patches.

    Signed-off-by: Amir Goldstein
    Signed-off-by: Miklos Szeredi

    Amir Goldstein
     
  • Document that inode index feature solves breaking hard links on
    copy up.

    Simplify Kconfig backward compatibility disclaimer.

    Signed-off-by: Amir Goldstein
    Signed-off-by: Miklos Szeredi

    Amir Goldstein
     

11 Dec, 2017

1 commit

  • Overlayfs is following redirects even when redirects are disabled. If this
    is unintentional (probably the majority of cases) then this can be a
    problem. E.g. upper layer comes from untrusted USB drive, and attacker
    crafts a redirect to enable read access to otherwise unreadable
    directories.

    If "redirect_dir=off", then turn off following as well as creation of
    redirects. If "redirect_dir=follow", then turn on following, but turn off
    creation of redirects (which is what "redirect_dir=off" does now).

    This is a backward incompatible change, so make it dependent on a config
    option.

    Reported-by: David Howells
    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     

05 Jul, 2017

1 commit

  • Create the index dir on mount. The index dir will contain hardlinks to
    upper inodes, named after the hex representation of their origin lower
    inodes.

    The index dir is going to be used to prevent breaking lower hardlinks
    on copy up and to implement overlayfs NFS export.

    Because the feature is not fully backward compat, enabling the feature
    is opt-in by config/module/mount option.

    Signed-off-by: Amir Goldstein
    Signed-off-by: Miklos Szeredi

    Amir Goldstein
     

15 May, 2017

1 commit

  • We get a link error when EXPORTFS is not enabled:

    ERROR: "exportfs_encode_fh" [fs/overlayfs/overlay.ko] undefined!
    ERROR: "exportfs_decode_fh" [fs/overlayfs/overlay.ko] undefined!

    This adds a Kconfig 'select' statement for overlayfs, the same way that
    it is done for the other users of exportfs.

    Fixes: 3a1e819b4e80 ("ovl: store file handle of lower inode on copy up")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Miklos Szeredi

    Arnd Bergmann
     

16 Dec, 2016

1 commit


20 Nov, 2014

1 commit

  • Some distributions carry an "old" format of overlayfs while mainline has a
    "new" format.

    The distros will possibly want to keep the old overlayfs alongside the new
    for compatibility reasons.

    To make it possible to differentiate the two versions change the name of
    the new one from "overlayfs" to "overlay".

    Signed-off-by: Miklos Szeredi
    Reported-by: Serge Hallyn
    Cc: Andy Whitcroft

    Miklos Szeredi
     

24 Oct, 2014

1 commit

  • Overlayfs allows one, usually read-write, directory tree to be
    overlaid onto another, read-only directory tree. All modifications
    go to the upper, writable layer.

    This type of mechanism is most often used for live CDs but there's a
    wide variety of other uses.

    The implementation differs from other "union filesystem"
    implementations in that after a file is opened all operations go
    directly to the underlying, lower or upper, filesystems. This
    simplifies the implementation and allows native performance in these
    cases.

    The dentry tree is duplicated from the underlying filesystems, this
    enables fast cached lookups without adding special support into the
    VFS. This uses slightly more memory than union mounts, but dentries
    are relatively small.

    Currently inodes are duplicated as well, but it is a possible
    optimization to share inodes for non-directories.

    Opening non directories results in the open forwarded to the
    underlying filesystem. This makes the behavior very similar to union
    mounts (with the same limitations vs. fchmod/fchown on O_RDONLY file
    descriptors).

    Usage:

    mount -t overlayfs overlayfs -olowerdir=/lower,upperdir=/upper/upper,workdir=/upper/work /overlay

    The following cotributions have been folded into this patch:

    Neil Brown :
    - minimal remount support
    - use correct seek function for directories
    - initialise is_real before use
    - rename ovl_fill_cache to ovl_dir_read

    Felix Fietkau :
    - fix a deadlock in ovl_dir_read_merged
    - fix a deadlock in ovl_remove_whiteouts

    Erez Zadok
    - fix cleanup after WARN_ON

    Sedat Dilek
    - fix up permission to confirm to new API

    Robin Dong
    - fix possible leak in ovl_new_inode
    - create new inode in ovl_link

    Andy Whitcroft
    - switch to __inode_permission()
    - copy up i_uid/i_gid from the underlying inode

    AV:
    - ovl_copy_up_locked() - dput(ERR_PTR(...)) on two failure exits
    - ovl_clear_empty() - one failure exit forgetting to do unlock_rename(),
    lack of check for udir being the parent of upper, dropping and regaining
    the lock on udir (which would require _another_ check for parent being
    right).
    - bogus d_drop() in copyup and rename [fix from your mail]
    - copyup/remove and copyup/rename races [fix from your mail]
    - ovl_dir_fsync() leaving ERR_PTR() in ->realfile
    - ovl_entry_free() is pointless - it's just a kfree_rcu()
    - fold ovl_do_lookup() into ovl_lookup()
    - manually assigning ->d_op is wrong. Just use ->s_d_op.
    [patches picked from Miklos]:
    * copyup/remove and copyup/rename races
    * bogus d_drop() in copyup and rename

    Also thanks to the following people for testing and reporting bugs:

    Jordi Pujol
    Andy Whitcroft
    Michal Suchanek
    Felix Fietkau
    Erez Zadok
    Randy Dunlap

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi