diff options
author | Abhi Das <adas@redhat.com> | 2014-03-31 10:33:17 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2014-03-31 16:41:39 +0100 |
commit | 059788039f1e6343f34f46d202f8d9f2158c2783 (patch) | |
tree | f122d85bf11e42c4b1babb1b720df747386ba95d /fs/gfs2/super.c | |
parent | e9fb7c73a43e0551e689b7024f1581af5fa36a03 (diff) | |
download | op-kernel-dev-059788039f1e6343f34f46d202f8d9f2158c2783.zip op-kernel-dev-059788039f1e6343f34f46d202f8d9f2158c2783.tar.gz |
GFS2: Fix uninitialized VFS inode in gfs2_create_inode
When gfs2_create_inode() fails due to quota violation, the VFS
inode is not completely uninitialized. This can cause a list
corruption error.
This patch correctly uninitializes the VFS inode when a quota
violation occurs in the gfs2_create_inode codepath.
Resolves: rhbz#1059808
Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index a08c66e..29cacd5 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -1248,7 +1248,7 @@ static int gfs2_drop_inode(struct inode *inode) { struct gfs2_inode *ip = GFS2_I(inode); - if (inode->i_nlink) { + if (!test_bit(GIF_FREE_VFS_INODE, &ip->i_flags) && inode->i_nlink) { struct gfs2_glock *gl = ip->i_iopen_gh.gh_gl; if (gl && test_bit(GLF_DEMOTE, &gl->gl_flags)) clear_nlink(inode); @@ -1463,6 +1463,11 @@ static void gfs2_evict_inode(struct inode *inode) struct gfs2_holder gh; int error; + if (test_bit(GIF_FREE_VFS_INODE, &ip->i_flags)) { + clear_inode(inode); + return; + } + if (inode->i_nlink || (sb->s_flags & MS_RDONLY)) goto out; |