mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Add overlay(-O) mount option support
Linux supports mounting over non-empty directories by default. In Solaris this is not the case and -O option is required for zfs mount to mount a zfs filesystem over a non-empty directory. For compatibility, I've added support for -O option to mount zfs filesystems over non-empty directories if the user wants to, just like in Solaris. I've defined MS_OVERLAY to record it in the flags variable if the -O option is supplied. The flags variable passes through a few functions and its checked before performing the empty directory check in zfs_mount function. If -O is given, the check is not performed. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #473
This commit is contained in:
committed by
Brian Behlendorf
parent
96b91ef0d6
commit
e18be9a637
@@ -440,9 +440,11 @@ zfs_mount(zfs_handle_t *zhp, const char *options, int flags)
|
||||
|
||||
/*
|
||||
* Determine if the mountpoint is empty. If so, refuse to perform the
|
||||
* mount. We don't perform this check if 'remount' is specified.
|
||||
* mount. We don't perform this check if 'remount' is
|
||||
* specified or if overlay option(-O) is given
|
||||
*/
|
||||
if (!remount && !dir_is_empty(mountpoint)) {
|
||||
if ((flags & MS_OVERLAY) == 0 && !remount &&
|
||||
!dir_is_empty(mountpoint)) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"directory is not empty"));
|
||||
return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED,
|
||||
|
||||
Reference in New Issue
Block a user