18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ciconfig OVERLAY_FS 38c2ecf20Sopenharmony_ci tristate "Overlay filesystem support" 48c2ecf20Sopenharmony_ci select EXPORTFS 58c2ecf20Sopenharmony_ci help 68c2ecf20Sopenharmony_ci An overlay filesystem combines two filesystems - an 'upper' filesystem 78c2ecf20Sopenharmony_ci and a 'lower' filesystem. When a name exists in both filesystems, the 88c2ecf20Sopenharmony_ci object in the 'upper' filesystem is visible while the object in the 98c2ecf20Sopenharmony_ci 'lower' filesystem is either hidden or, in the case of directories, 108c2ecf20Sopenharmony_ci merged with the 'upper' object. 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci For more information see Documentation/filesystems/overlayfs.rst 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ciconfig OVERLAY_FS_REDIRECT_DIR 158c2ecf20Sopenharmony_ci bool "Overlayfs: turn on redirect directory feature by default" 168c2ecf20Sopenharmony_ci depends on OVERLAY_FS 178c2ecf20Sopenharmony_ci help 188c2ecf20Sopenharmony_ci If this config option is enabled then overlay filesystems will use 198c2ecf20Sopenharmony_ci redirects when renaming directories by default. In this case it is 208c2ecf20Sopenharmony_ci still possible to turn off redirects globally with the 218c2ecf20Sopenharmony_ci "redirect_dir=off" module option or on a filesystem instance basis 228c2ecf20Sopenharmony_ci with the "redirect_dir=off" mount option. 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci Note, that redirects are not backward compatible. That is, mounting 258c2ecf20Sopenharmony_ci an overlay which has redirects on a kernel that doesn't support this 268c2ecf20Sopenharmony_ci feature will have unexpected results. 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci If unsure, say N. 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciconfig OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW 318c2ecf20Sopenharmony_ci bool "Overlayfs: follow redirects even if redirects are turned off" 328c2ecf20Sopenharmony_ci default y 338c2ecf20Sopenharmony_ci depends on OVERLAY_FS 348c2ecf20Sopenharmony_ci help 358c2ecf20Sopenharmony_ci Disable this to get a possibly more secure configuration, but that 368c2ecf20Sopenharmony_ci might not be backward compatible with previous kernels. 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci If backward compatibility is not an issue, then it is safe and 398c2ecf20Sopenharmony_ci recommended to say N here. 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci For more information, see Documentation/filesystems/overlayfs.rst 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci If unsure, say Y. 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciconfig OVERLAY_FS_INDEX 468c2ecf20Sopenharmony_ci bool "Overlayfs: turn on inodes index feature by default" 478c2ecf20Sopenharmony_ci depends on OVERLAY_FS 488c2ecf20Sopenharmony_ci help 498c2ecf20Sopenharmony_ci If this config option is enabled then overlay filesystems will use 508c2ecf20Sopenharmony_ci the index directory to map lower inodes to upper inodes by default. 518c2ecf20Sopenharmony_ci In this case it is still possible to turn off index globally with the 528c2ecf20Sopenharmony_ci "index=off" module option or on a filesystem instance basis with the 538c2ecf20Sopenharmony_ci "index=off" mount option. 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci The inodes index feature prevents breaking of lower hardlinks on copy 568c2ecf20Sopenharmony_ci up. 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci Note, that the inodes index feature is not backward compatible. 598c2ecf20Sopenharmony_ci That is, mounting an overlay which has an inodes index on a kernel 608c2ecf20Sopenharmony_ci that doesn't support this feature will have unexpected results. 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci If unsure, say N. 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ciconfig OVERLAY_FS_NFS_EXPORT 658c2ecf20Sopenharmony_ci bool "Overlayfs: turn on NFS export feature by default" 668c2ecf20Sopenharmony_ci depends on OVERLAY_FS 678c2ecf20Sopenharmony_ci depends on OVERLAY_FS_INDEX 688c2ecf20Sopenharmony_ci depends on !OVERLAY_FS_METACOPY 698c2ecf20Sopenharmony_ci help 708c2ecf20Sopenharmony_ci If this config option is enabled then overlay filesystems will use 718c2ecf20Sopenharmony_ci the index directory to decode overlay NFS file handles by default. 728c2ecf20Sopenharmony_ci In this case, it is still possible to turn off NFS export support 738c2ecf20Sopenharmony_ci globally with the "nfs_export=off" module option or on a filesystem 748c2ecf20Sopenharmony_ci instance basis with the "nfs_export=off" mount option. 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci The NFS export feature creates an index on copy up of every file and 778c2ecf20Sopenharmony_ci directory. This full index is used to detect overlay filesystems 788c2ecf20Sopenharmony_ci inconsistencies on lookup, like redirect from multiple upper dirs to 798c2ecf20Sopenharmony_ci the same lower dir. The full index may incur some overhead on mount 808c2ecf20Sopenharmony_ci time, especially when verifying that directory file handles are not 818c2ecf20Sopenharmony_ci stale. 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci Note, that the NFS export feature is not backward compatible. 848c2ecf20Sopenharmony_ci That is, mounting an overlay which has a full index on a kernel 858c2ecf20Sopenharmony_ci that doesn't support this feature will have unexpected results. 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci Most users should say N here and enable this feature on a case-by- 888c2ecf20Sopenharmony_ci case basis with the "nfs_export=on" mount option. 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci Say N unless you fully understand the consequences. 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ciconfig OVERLAY_FS_XINO_AUTO 938c2ecf20Sopenharmony_ci bool "Overlayfs: auto enable inode number mapping" 948c2ecf20Sopenharmony_ci default n 958c2ecf20Sopenharmony_ci depends on OVERLAY_FS 968c2ecf20Sopenharmony_ci depends on 64BIT 978c2ecf20Sopenharmony_ci help 988c2ecf20Sopenharmony_ci If this config option is enabled then overlay filesystems will use 998c2ecf20Sopenharmony_ci unused high bits in undelying filesystem inode numbers to map all 1008c2ecf20Sopenharmony_ci inodes to a unified address space. The mapped 64bit inode numbers 1018c2ecf20Sopenharmony_ci might not be compatible with applications that expect 32bit inodes. 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci If compatibility with applications that expect 32bit inodes is not an 1048c2ecf20Sopenharmony_ci issue, then it is safe and recommended to say Y here. 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci For more information, see Documentation/filesystems/overlayfs.rst 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci If unsure, say N. 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ciconfig OVERLAY_FS_METACOPY 1118c2ecf20Sopenharmony_ci bool "Overlayfs: turn on metadata only copy up feature by default" 1128c2ecf20Sopenharmony_ci depends on OVERLAY_FS 1138c2ecf20Sopenharmony_ci select OVERLAY_FS_REDIRECT_DIR 1148c2ecf20Sopenharmony_ci help 1158c2ecf20Sopenharmony_ci If this config option is enabled then overlay filesystems will 1168c2ecf20Sopenharmony_ci copy up only metadata where appropriate and data copy up will 1178c2ecf20Sopenharmony_ci happen when a file is opened for WRITE operation. It is still 1188c2ecf20Sopenharmony_ci possible to turn off this feature globally with the "metacopy=off" 1198c2ecf20Sopenharmony_ci module option or on a filesystem instance basis with the 1208c2ecf20Sopenharmony_ci "metacopy=off" mount option. 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ci Note, that this feature is not backward compatible. That is, 1238c2ecf20Sopenharmony_ci mounting an overlay which has metacopy only inodes on a kernel 1248c2ecf20Sopenharmony_ci that doesn't support this feature will have unexpected results. 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci If unsure, say N. 127