]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ovl: upper fs should not be R/O
authorhujianyang <hujianyang@huawei.com>
Thu, 15 Jan 2015 05:20:57 +0000 (13:20 +0800)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 18 Mar 2015 09:29:48 +0000 (10:29 +0100)
commit71cbad7e694ee81233b3be3a38b81c3d5872cc6f
treefc347950aaca4246d692295ec925b7ec81e72168
parent6be4506e34cf6075a1307b646e0a6c46c1c9010d
ovl: upper fs should not be R/O

After importing multi-lower layer support, users could mount a r/o
partition as the left most lowerdir instead of using it as upperdir.
And a r/o upperdir may cause an error like

overlayfs: failed to create directory ./workdir/work

during mount.

This patch check the *s_flags* of upper fs and return an error if
it is a r/o partition. The checking of *upper_mnt->mnt_sb->s_flags*
can be removed now.

This patch also remove

/* FIXME: workdir is not needed for a R/O mount */

from ovl_fill_super() because:

1) for upper fs r/o case
Setting a r/o partition as upper is prevented, no need to care about
workdir in this case.

2) for "mount overlay -o ro" with a r/w upper fs case
Users could remount overlayfs to r/w in this case, so workdir should
not be omitted.

Signed-off-by: hujianyang <hujianyang@huawei.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/overlayfs/super.c