Message ID | 20210414123750.2110159-6-brauner@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fs: tweak and switch more fses to private mounts | expand |
diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c index 7ef572d698f0..8cf283de4e14 100644 --- a/fs/cachefiles/bind.c +++ b/fs/cachefiles/bind.c @@ -141,8 +141,13 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache) !root->d_sb->s_op->sync_fs) goto error_unsupported; + /* + * Verify our mount and superblock aren't read-only. + * Note, while our private mount is guaranteed to not change anymore + * the superblock may still go read-only later. + */ ret = -EROFS; - if (sb_rdonly(root->d_sb)) + if (__mnt_is_readonly(cache->mnt)) goto error_unsupported; /* determine the security of the on-disk cache as this governs