Skip to content

Commit

Permalink
GFS2: Fix ref count bug relating to atomic_open
Browse files Browse the repository at this point in the history
In the case that atomic_open calls finish_no_open() with
the dentry that was supplied to gfs2_atomic_open() an
extra reference count is required. This patch fixes that
issue preventing a bug trap triggering at umount time.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Nov 21, 2013
1 parent e3c4269 commit ea0341e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,11 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
if (d != NULL)
dentry = d;
if (dentry->d_inode) {
if (!(*opened & FILE_OPENED))
if (!(*opened & FILE_OPENED)) {
if (d == NULL)
dget(dentry);
return finish_no_open(file, dentry);
}
dput(d);
return 0;
}
Expand Down

0 comments on commit ea0341e

Please sign in to comment.