]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
devpts: Must release s_umount on error
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Thu, 29 Jan 2009 00:57:12 +0000 (16:57 -0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 27 Mar 2009 18:43:59 +0000 (14:43 -0400)
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>
fs/devpts/inode.c

index bff4052b05e7003744a57e19b7d38966c7a75d71..140b43144cd823f3b9e530481fe2084a81a4cff2 100644 (file)
@@ -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;
 }
@@ -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);
        }