lkml.org 
[lkml]   [2013]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] vfs: statfs: A fs is r/o if the superblock is
Date
By calling mount(2) with MS_REMOUNT | MS_BIND on a non-bind readonly
mountpoint, it is possible to have a readonly mount without MNT_READONLY
in its mnt_flags. Currently, statfs will not set the ST_RDONLY flag in
f_flags for such a mount, even though for all intents and purposes it is
still readonly.

This patch makes vfs_statfs set ST_RDONLY in f_flags if mnt_sb->s_flags
contains MS_RDONLY.

Signed-off-by: Shea Levy <shea@shealevy.com>
---
fs/statfs.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/statfs.c b/fs/statfs.c
index c219e733..c614087 100644
--- a/fs/statfs.c
+++ b/fs/statfs.c
@@ -37,6 +37,8 @@ static int flags_by_sb(int s_flags)
flags |= ST_SYNCHRONOUS;
if (s_flags & MS_MANDLOCK)
flags |= ST_MANDLOCK;
+ if (s_flags & MS_RDONLY)
+ flags |= ST_RDONLY;
return flags;
}

--
1.8.1.3


\
 
 \ /
  Last update: 2013-03-14 17:44    [W:0.078 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site