Skip to contentSkip to conversation

devpts: Must release s_umount on error

RFC PATCH In review Sukadev Bhattiprolu 2 participants 2 messages Jan 29, 2009 – Feb 1, 2009

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 devpts: Must release s_umount on error

From: Sukadev Bhattiprolu <[email protected]>
Date: Wed, 28 Jan 2009 16:57:12 -0800
Subject: [RFC][PATCH] 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.

---
 fs/devpts/inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/devpts/inode.c +2 -0
index d008105..ad186b4 100644
@@ -390,6 +390,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;
 }
@@ -479,6 +480,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);
 	}
 
Signature · 1 line
1.5.2.5
#1 lore raw
Quoted 8 lines · Sukadev Bhattiprolu

From: Sukadev Bhattiprolu <[email protected]>
Date: Wed, 28 Jan 2009 16:57:12 -0800
Subject: [RFC][PATCH] 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.

Looks good and should probably be submitted for 2.6.29.