linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] FS: hfsplus, fix lock imbalance
@ 2010-10-27 11:51 Jiri Slaby
  2010-10-27 11:52 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2010-10-27 11:51 UTC (permalink / raw)
  To: hch; +Cc: linux-fsdevel, linux-kernel, jirislaby

Stanse found that there is mutex_lock in a fail path of
hfsplus_ioctl_setflags (i.e. double lock + leaving a function in
locked state). So fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Christoph Hellwig <hch@tuxera.com>
---
 fs/hfsplus/ioctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
index 5b4667e..40a85a3 100644
--- a/fs/hfsplus/ioctl.c
+++ b/fs/hfsplus/ioctl.c
@@ -92,7 +92,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
 	mark_inode_dirty(inode);
 
 out_unlock_inode:
-	mutex_lock(&inode->i_mutex);
+	mutex_unlock(&inode->i_mutex);
 out_drop_write:
 	mnt_drop_write(file->f_path.mnt);
 out:
-- 
1.7.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] FS: hfsplus, fix lock imbalance
  2010-10-27 11:51 [PATCH] FS: hfsplus, fix lock imbalance Jiri Slaby
@ 2010-10-27 11:52 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2010-10-27 11:52 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: hch, linux-fsdevel, linux-kernel, jirislaby

On Wed, Oct 27, 2010 at 01:51:15PM +0200, Jiri Slaby wrote:
> Stanse found that there is mutex_lock in a fail path of
> hfsplus_ioctl_setflags (i.e. double lock + leaving a function in
> locked state). So fix that.

Dan Carpenter already sent the same fix and I applied it.  I'll push it
out to Linus soon.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-27 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 11:51 [PATCH] FS: hfsplus, fix lock imbalance Jiri Slaby
2010-10-27 11:52 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).