提交 a9f184f0 编写于 作者: S Sukadev Bhattiprolu 提交者: Al Viro

devpts: Must release s_umount on error

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: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 af5df566
...@@ -385,6 +385,7 @@ static int new_pts_mount(struct file_system_type *fs_type, int flags, ...@@ -385,6 +385,7 @@ static int new_pts_mount(struct file_system_type *fs_type, int flags,
fail: fail:
dput(mnt->mnt_sb->s_root); dput(mnt->mnt_sb->s_root);
up_write(&mnt->mnt_sb->s_umount);
deactivate_super(mnt->mnt_sb); deactivate_super(mnt->mnt_sb);
return err; return err;
} }
...@@ -473,6 +474,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags, ...@@ -473,6 +474,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
err = mknod_ptmx(mnt->mnt_sb); err = mknod_ptmx(mnt->mnt_sb);
if (err) { if (err) {
dput(mnt->mnt_sb->s_root); dput(mnt->mnt_sb->s_root);
up_write(&mnt->mnt_sb->s_umount);
deactivate_super(mnt->mnt_sb); deactivate_super(mnt->mnt_sb);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册