Skip to content

Commit a9f184f

Browse files
Sukadev BhattiproluAl Viro
authored andcommitted
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: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent af5df56 commit a9f184f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/devpts/inode.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ static int new_pts_mount(struct file_system_type *fs_type, int flags,
385385

386386
fail:
387387
dput(mnt->mnt_sb->s_root);
388+
up_write(&mnt->mnt_sb->s_umount);
388389
deactivate_super(mnt->mnt_sb);
389390
return err;
390391
}
@@ -473,6 +474,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
473474
err = mknod_ptmx(mnt->mnt_sb);
474475
if (err) {
475476
dput(mnt->mnt_sb->s_root);
477+
up_write(&mnt->mnt_sb->s_umount);
476478
deactivate_super(mnt->mnt_sb);
477479
}
478480

0 commit comments

Comments
 (0)