From: Amir Goldstein Date: Thu, 8 Apr 2021 11:30:20 +0000 (+0300) Subject: ovl: check that upperdir path is not on a read-only mount X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e21a6c57e3905313664aa012727346a0067effd5;p=linux.git ovl: check that upperdir path is not on a read-only mount So far we only checked that sb is not read-only. Suggested-by: Christian Brauner Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index fdd72f1a9c5e0..8d83663500930 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1185,8 +1185,8 @@ static int ovl_get_upper(struct super_block *sb, struct ovl_fs *ofs, if (err) goto out; - /* Upper fs should not be r/o */ - if (sb_rdonly(upperpath->mnt->mnt_sb)) { + /* Upperdir path should not be r/o */ + if (__mnt_is_readonly(upperpath->mnt)) { pr_err("upper fs is r/o, try multi-lower layers mount\n"); err = -EINVAL; goto out;