All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namjae Jeon <namjae.jeon@samsung.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: 'Dan Carpenter' <dan.carpenter@oracle.com>,
	linux-ext4 <linux-ext4@vger.kernel.org>,
	Ashish Sangwan <a.sangwan@samsung.com>
Subject: [PATCH] ext4: fix missing unlock on error in collapse range
Date: Tue, 27 May 2014 09:09:15 +0900	[thread overview]
Message-ID: <000601cf793f$e5377070$afa65150$@samsung.com> (raw)

Add i_write_mutex unlock on the error handling path in collapse_range().

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
---
 fs/ext4/extents.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index ee14768..0c93423 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5447,8 +5447,10 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
 	/* Write out all dirty pages */
 	ret = filemap_write_and_wait_range(inode->i_mapping, ioffset,
 					   LLONG_MAX);
-	if (ret)
+	if (ret) {
+		mutex_unlock(&EXT4_I(inode)->i_write_mutex);
 		return ret;
+	}
 
 	/* Take mutex lock */
 	mutex_lock(&inode->i_mutex);
-- 
1.7.11-rc0


             reply	other threads:[~2014-05-27  0:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27  0:09 Namjae Jeon [this message]
2014-05-27 16:48 ` [PATCH] ext4: fix missing unlock on error in collapse range Theodore Ts'o
2014-05-28  0:15   ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000601cf793f$e5377070$afa65150$@samsung.com' \
    --to=namjae.jeon@samsung.com \
    --cc=a.sangwan@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.