162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ciconfig OVERLAY_FS
362306a36Sopenharmony_ci	tristate "Overlay filesystem support"
462306a36Sopenharmony_ci	select EXPORTFS
562306a36Sopenharmony_ci	help
662306a36Sopenharmony_ci	  An overlay filesystem combines two filesystems - an 'upper' filesystem
762306a36Sopenharmony_ci	  and a 'lower' filesystem.  When a name exists in both filesystems, the
862306a36Sopenharmony_ci	  object in the 'upper' filesystem is visible while the object in the
962306a36Sopenharmony_ci	  'lower' filesystem is either hidden or, in the case of directories,
1062306a36Sopenharmony_ci	  merged with the 'upper' object.
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci	  For more information see Documentation/filesystems/overlayfs.rst
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ciconfig OVERLAY_FS_REDIRECT_DIR
1562306a36Sopenharmony_ci	bool "Overlayfs: turn on redirect directory feature by default"
1662306a36Sopenharmony_ci	depends on OVERLAY_FS
1762306a36Sopenharmony_ci	help
1862306a36Sopenharmony_ci	  If this config option is enabled then overlay filesystems will use
1962306a36Sopenharmony_ci	  redirects when renaming directories by default.  In this case it is
2062306a36Sopenharmony_ci	  still possible to turn off redirects globally with the
2162306a36Sopenharmony_ci	  "redirect_dir=off" module option or on a filesystem instance basis
2262306a36Sopenharmony_ci	  with the "redirect_dir=off" mount option.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci	  Note, that redirects are not backward compatible.  That is, mounting
2562306a36Sopenharmony_ci	  an overlay which has redirects on a kernel that doesn't support this
2662306a36Sopenharmony_ci	  feature will have unexpected results.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci	  If unsure, say N.
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciconfig OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW
3162306a36Sopenharmony_ci	bool "Overlayfs: follow redirects even if redirects are turned off"
3262306a36Sopenharmony_ci	default y
3362306a36Sopenharmony_ci	depends on OVERLAY_FS
3462306a36Sopenharmony_ci	help
3562306a36Sopenharmony_ci	  Disable this to get a possibly more secure configuration, but that
3662306a36Sopenharmony_ci	  might not be backward compatible with previous kernels.
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci	  If backward compatibility is not an issue, then it is safe and
3962306a36Sopenharmony_ci	  recommended to say N here.
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci	  For more information, see Documentation/filesystems/overlayfs.rst
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci	  If unsure, say Y.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ciconfig OVERLAY_FS_INDEX
4662306a36Sopenharmony_ci	bool "Overlayfs: turn on inodes index feature by default"
4762306a36Sopenharmony_ci	depends on OVERLAY_FS
4862306a36Sopenharmony_ci	help
4962306a36Sopenharmony_ci	  If this config option is enabled then overlay filesystems will use
5062306a36Sopenharmony_ci	  the index directory to map lower inodes to upper inodes by default.
5162306a36Sopenharmony_ci	  In this case it is still possible to turn off index globally with the
5262306a36Sopenharmony_ci	  "index=off" module option or on a filesystem instance basis with the
5362306a36Sopenharmony_ci	  "index=off" mount option.
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci	  The inodes index feature prevents breaking of lower hardlinks on copy
5662306a36Sopenharmony_ci	  up.
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci	  Note, that the inodes index feature is not backward compatible.
5962306a36Sopenharmony_ci	  That is, mounting an overlay which has an inodes index on a kernel
6062306a36Sopenharmony_ci	  that doesn't support this feature will have unexpected results.
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci	  If unsure, say N.
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ciconfig OVERLAY_FS_NFS_EXPORT
6562306a36Sopenharmony_ci	bool "Overlayfs: turn on NFS export feature by default"
6662306a36Sopenharmony_ci	depends on OVERLAY_FS
6762306a36Sopenharmony_ci	depends on OVERLAY_FS_INDEX
6862306a36Sopenharmony_ci	depends on !OVERLAY_FS_METACOPY
6962306a36Sopenharmony_ci	help
7062306a36Sopenharmony_ci	  If this config option is enabled then overlay filesystems will use
7162306a36Sopenharmony_ci	  the index directory to decode overlay NFS file handles by default.
7262306a36Sopenharmony_ci	  In this case, it is still possible to turn off NFS export support
7362306a36Sopenharmony_ci	  globally with the "nfs_export=off" module option or on a filesystem
7462306a36Sopenharmony_ci	  instance basis with the "nfs_export=off" mount option.
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci	  The NFS export feature creates an index on copy up of every file and
7762306a36Sopenharmony_ci	  directory.  This full index is used to detect overlay filesystems
7862306a36Sopenharmony_ci	  inconsistencies on lookup, like redirect from multiple upper dirs to
7962306a36Sopenharmony_ci	  the same lower dir.  The full index may incur some overhead on mount
8062306a36Sopenharmony_ci	  time, especially when verifying that directory file handles are not
8162306a36Sopenharmony_ci	  stale.
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci	  Note, that the NFS export feature is not backward compatible.
8462306a36Sopenharmony_ci	  That is, mounting an overlay which has a full index on a kernel
8562306a36Sopenharmony_ci	  that doesn't support this feature will have unexpected results.
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci	  Most users should say N here and enable this feature on a case-by-
8862306a36Sopenharmony_ci	  case basis with the "nfs_export=on" mount option.
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci	  Say N unless you fully understand the consequences.
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ciconfig OVERLAY_FS_XINO_AUTO
9362306a36Sopenharmony_ci	bool "Overlayfs: auto enable inode number mapping"
9462306a36Sopenharmony_ci	default n
9562306a36Sopenharmony_ci	depends on OVERLAY_FS
9662306a36Sopenharmony_ci	depends on 64BIT
9762306a36Sopenharmony_ci	help
9862306a36Sopenharmony_ci	  If this config option is enabled then overlay filesystems will use
9962306a36Sopenharmony_ci	  unused high bits in underlying filesystem inode numbers to map all
10062306a36Sopenharmony_ci	  inodes to a unified address space.  The mapped 64bit inode numbers
10162306a36Sopenharmony_ci	  might not be compatible with applications that expect 32bit inodes.
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci	  If compatibility with applications that expect 32bit inodes is not an
10462306a36Sopenharmony_ci	  issue, then it is safe and recommended to say Y here.
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci	  For more information, see Documentation/filesystems/overlayfs.rst
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci	  If unsure, say N.
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ciconfig OVERLAY_FS_METACOPY
11162306a36Sopenharmony_ci	bool "Overlayfs: turn on metadata only copy up feature by default"
11262306a36Sopenharmony_ci	depends on OVERLAY_FS
11362306a36Sopenharmony_ci	select OVERLAY_FS_REDIRECT_DIR
11462306a36Sopenharmony_ci	help
11562306a36Sopenharmony_ci	  If this config option is enabled then overlay filesystems will
11662306a36Sopenharmony_ci	  copy up only metadata where appropriate and data copy up will
11762306a36Sopenharmony_ci	  happen when a file is opened for WRITE operation. It is still
11862306a36Sopenharmony_ci	  possible to turn off this feature globally with the "metacopy=off"
11962306a36Sopenharmony_ci	  module option or on a filesystem instance basis with the
12062306a36Sopenharmony_ci	  "metacopy=off" mount option.
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci	  Note, that this feature is not backward compatible.  That is,
12362306a36Sopenharmony_ci	  mounting an overlay which has metacopy only inodes on a kernel
12462306a36Sopenharmony_ci	  that doesn't support this feature will have unexpected results.
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci	  If unsure, say N.
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ciconfig OVERLAY_FS_DEBUG
12962306a36Sopenharmony_ci	bool "Overlayfs: turn on extra debugging checks"
13062306a36Sopenharmony_ci	default n
13162306a36Sopenharmony_ci	depends on OVERLAY_FS
13262306a36Sopenharmony_ci	help
13362306a36Sopenharmony_ci	  Say Y here to enable extra debugging checks in overlayfs.
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci	  If unsure, say N.
136