Skip to content

Commit

Permalink
devpts: Must release s_umount on error
Browse files Browse the repository at this point in the history
We should drop the ->s_umount mutex if an error occurs after the
sget()/grab_super() call. This was introduced when adding support
for multiple instances of devpts and noticed during a code review/reorg.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Sukadev Bhattiprolu authored and Al Viro committed Mar 27, 2009
1 parent af5df56 commit a9f184f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ static int new_pts_mount(struct file_system_type *fs_type, int flags,

fail:
dput(mnt->mnt_sb->s_root);
up_write(&mnt->mnt_sb->s_umount);
deactivate_super(mnt->mnt_sb);
return err;
}
Expand Down Expand Up @@ -473,6 +474,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
err = mknod_ptmx(mnt->mnt_sb);
if (err) {
dput(mnt->mnt_sb->s_root);
up_write(&mnt->mnt_sb->s_umount);
deactivate_super(mnt->mnt_sb);
}

Expand Down

0 comments on commit a9f184f

Please sign in to comment.