All of lore.kernel.org
 help / color / mirror / Atom feed
* PROBLEM: Mounting multiple lowerdirs with "lowerdir=/tmp/a0,/tmp/a" returns 32
@ 2015-01-12 21:59 Fabian Sturm
  2015-01-13  2:17 ` hujianyang
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Sturm @ 2015-01-12 21:59 UTC (permalink / raw)
  To: miklos; +Cc: linux-unionfs

1. If one lowerdir-folder path includes a number, fails to mount.

3. Keywords: overlayfs, overlay

4. Linux version 3.18.0+ (user@localhost) (gcc version 4.9.1 
(Debian 4.9.1-19) ) #4 SMP Mon Jan 12 19:31:53 CET 2015

6. The following script reproduces the behaviour on my machine:

#! /bin/bash

mkdir -p /tmp/a
mkdir -p /tmp/b0/b
mkdir -p /tmp/merged

mkdir -p /tmp/a0
mkdir -p /tmp/0a
mkdir -p /tmp/a0a

touch /tmp/a/A
touch /tmp/a0/A
touch /tmp/0a/A
touch /tmp/a0a/A

touch /tmp/b0/b/A

sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/a0 overlay /tmp/merged
ret=$(echo $?)
echo $ret
if [[ "$ret" == "0" ]]; then
    sudo umount /tmp/merged
fi

sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/0a overlay /tmp/merged
ret=$(echo $?)
echo $ret
if [[ "$ret" == "0" ]]; then
    sudo umount /tmp/merged
fi

sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/a0a overlay /tmp/merged
ret=$(echo $?)
echo $ret
if [[ "$ret" == "0" ]]; then
    sudo umount /tmp/merged
fi

sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/b0/b overlay /tmp/merged
ret=$(echo $?)
echo $ret
if [[ "$ret" == "0" ]]; then
    sudo umount /tmp/merged
fi

7. Environment

TERM=xterm
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=de_DE.UTF-8
PS1=\[\e[1;32m\]\u@\h:\w${text}$\[\e[m\]
LANGUAGE=
DISPLAY=:0
SHELL=/bin/bash
MAIL=/var/mail/root
LOGNAME=root
USER=root
USERNAME=root
HOME=/root
SUDO_COMMAND=/usr/bin/env
SUDO_USER=zeroxray
SUDO_UID=1000
SUDO_GID=1000

7.1 what does ver_linux do? made overlayfs builtin dunno wether it matters..

If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.

Linux debian-desktop-mine 3.18.0+ #4 SMP Mon Jan 12 19:31:53 CET 2015 x86_64 
GNU/Linux

Gnu C                  4.9.1
Gnu make               4.0
binutils               2.24.90.20141023
util-linux             scripts/ver_linux: 23: scripts/ver_linux: fdformat: not 
found
mount                  debug
module-init-tools      found
Linux C Library        2.19
Dynamic linker (ldd)   2.19
Procps                 3.3.9
Kbd                    1.15.5
Sh-utils               8.23
Modules Loaded         vfat fat bnep bridge stp llc nfnetlink_queue 
nfnetlink_log nfnetlink bluetooth cfg80211 binfmt_misc rfkill crc16 
iptable_filter ip_tables x_tables nfsd auth_rpcgss oid_registry nfs_acl nfs 
lockd grace fscache sunrpc x86_pkg_temp_thermal intel_powerclamp intel_rapl 
coretemp kvm_intel iTCO_wdt snd_hda_codec_realtek snd_hda_codec_generic 
snd_hda_codec_hdmi kvm iTCO_vendor_support nouveau video ttm snd_hda_intel 
mxm_wmi xhci_pci joydev evdev drm_kms_helper snd_hda_controller snd_hda_codec 
psmouse snd_hwdep serio_raw xhci_hcd drm lpc_ich mei_me snd_pcm snd_timer snd 
i2c_algo_bit i2c_i801 soundcore i2c_core mei mfd_core tpm_infineon tpm_tis tpm 
wmi pcspkr shpchp processor button thermal_sys cuse fuse parport_pc ppdev lp 
parport loop autofs4 algif_skcipher af_alg dm_crypt dm_mod hid_cherry 
hid_generic usbhid hid sg sr_mod cdrom sd_mod crct10dif_pclmul crc32_pclmul 
crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul 
glue_helper ablk_helper cryptd ahci libahci libata firewire_ohci scsi_mod 
firewire_core ehci_pci crc_itu_t r8169 ehci_hcd mii usbcore usb_common



If more stuff is needed tell me, but I cant see what other things would have to 
do with the problem.

The used tree comes from 
https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-
next commit 4330397e4e8a662f36d101659e2a59ce32e76ff4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROBLEM: Mounting multiple lowerdirs with "lowerdir=/tmp/a0,/tmp/a" returns 32
  2015-01-12 21:59 PROBLEM: Mounting multiple lowerdirs with "lowerdir=/tmp/a0,/tmp/a" returns 32 Fabian Sturm
@ 2015-01-13  2:17 ` hujianyang
  2015-01-13  8:27   ` Fabian Sturm
  0 siblings, 1 reply; 3+ messages in thread
From: hujianyang @ 2015-01-13  2:17 UTC (permalink / raw)
  To: Fabian Sturm; +Cc: miklos, linux-unionfs

Hi Fabian,

Thanks for reporting.

On 2015/1/13 5:59, Fabian Sturm wrote:
> 
> sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/a0 overlay /tmp/merged

I think the cause of this failure is the wrong mount option you
are using.

should be:

sudo mount -t overlay -o lowerdir=/tmp/a:/tmp/a0 overlay /tmp/merged

Comma is used to separate different mount options. Overlayfs use
colon as the separator between lower directories.

I don't know if it is a correct resolution for your problem. You
can try it first. It's OK in my environment to mount ovl with
numbers in directory name.

> ret=$(echo $?)
> echo $ret
> if [[ "$ret" == "0" ]]; then
>     sudo umount /tmp/merged
> fi
> 
> sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/0a overlay /tmp/merged
> ret=$(echo $?)
> echo $ret
> if [[ "$ret" == "0" ]]; then
>     sudo umount /tmp/merged
> fi
> 

Anyway, I think overlayfs should print an error message if an
incorrect mount option is caught like other filesystems.


Reported-by: Fabian Sturm <fabian.sturm@aduu.de>
Signed-off-by: hujianyang <hujianyang@huawei.com>
---
 fs/overlayfs/super.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index b90952f..ab3c8cb 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -615,6 +615,7 @@ static int ovl_parse_opt(char *opt, struct ovl_config *config)
 			break;

 		default:
+			pr_err("overlayfs: unrecognized mount option \"%s\" or missing value\n", p);
 			return -EINVAL;
 		}
 	}
-- 
1.6.0.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: PROBLEM: Mounting multiple lowerdirs with "lowerdir=/tmp/a0,/tmp/a" returns 32
  2015-01-13  2:17 ` hujianyang
@ 2015-01-13  8:27   ` Fabian Sturm
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Sturm @ 2015-01-13  8:27 UTC (permalink / raw)
  To: hujianyang; +Cc: miklos, linux-unionfs

Am Dienstag, 13. Januar 2015, 10:17:57 schrieben Sie:
> Hi Fabian,
> 
> Thanks for reporting.
> 
> On 2015/1/13 5:59, Fabian Sturm wrote:
> > sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/a0 overlay /tmp/merged
> 
> I think the cause of this failure is the wrong mount option you
> are using.
> 
> should be:
> 
> sudo mount -t overlay -o lowerdir=/tmp/a:/tmp/a0 overlay /tmp/merged
> 
> Comma is used to separate different mount options. Overlayfs use
> colon as the separator between lower directories.
> 
> I don't know if it is a correct resolution for your problem. You
> can try it first. It's OK in my environment to mount ovl with
> numbers in directory name.
> 
> > ret=$(echo $?)
> > echo $ret
> > if [[ "$ret" == "0" ]]; then
> > 
> >     sudo umount /tmp/merged
> > 
> > fi
> > 
> > sudo mount -t overlay -o lowerdir=/tmp/a,/tmp/0a overlay /tmp/merged
> > ret=$(echo $?)
> > echo $ret
> > if [[ "$ret" == "0" ]]; then
> > 
> >     sudo umount /tmp/merged
> > 
> > fi
> 
> Anyway, I think overlayfs should print an error message if an
> incorrect mount option is caught like other filesystems.
> 
> 
> Reported-by: Fabian Sturm <fabian.sturm@aduu.de>
> Signed-off-by: hujianyang <hujianyang@huawei.com>
> ---
>  fs/overlayfs/super.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index b90952f..ab3c8cb 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -615,6 +615,7 @@ static int ovl_parse_opt(char *opt, struct ovl_config
> *config) break;
> 
>  		default:
> +			pr_err("overlayfs: unrecognized mount option \"%s\" or missing 
value\n",
> p); return -EINVAL;
>  		}
>  	}

Hello hujianyang,

I might have had not enough sleep at the time. Thanks for adding the output to 
dmesg, works fine!

Thanks,
Fabian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-13  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12 21:59 PROBLEM: Mounting multiple lowerdirs with "lowerdir=/tmp/a0,/tmp/a" returns 32 Fabian Sturm
2015-01-13  2:17 ` hujianyang
2015-01-13  8:27   ` Fabian Sturm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.