diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-03-30 14:17:51 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-04-18 15:23:12 +0100 |
commit | 001e8e8df4283dd4ef7a0297c012fce364c05cf1 (patch) | |
tree | 28942d4cadc3da175a352c9804dad502d2bc4336 /fs/gfs2/super.c | |
parent | 0ee532062fa7ff0795b3862c2d50efe32e552f9f (diff) | |
download | linux-001e8e8df4283dd4ef7a0297c012fce364c05cf1.tar.gz linux-001e8e8df4283dd4ef7a0297c012fce364c05cf1.tar.bz2 linux-001e8e8df4283dd4ef7a0297c012fce364c05cf1.zip |
GFS2: Don't try to deallocate unlinked inodes when mounted ro
This adds a couple of missing tests to avoid read-only nodes
from attempting to deallocate unlinked inodes.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Reported-by: Michel Andre de la Porte <madelaporte@ubi.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index a4e23d68a398..5b2cb8132f66 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -1318,12 +1318,13 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt) static void gfs2_evict_inode(struct inode *inode) { - struct gfs2_sbd *sdp = inode->i_sb->s_fs_info; + struct super_block *sb = inode->i_sb; + struct gfs2_sbd *sdp = sb->s_fs_info; struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_holder gh; int error; - if (inode->i_nlink) + if (inode->i_nlink || (sb->s_flags & MS_RDONLY)) goto out; error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); |