linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ext4: fix missing unlock on error in ext4_punch_hole()
@ 2013-06-18  3:40 Wei Yongjun
  2013-06-18 15:05 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-06-18  3:40 UTC (permalink / raw)
  To: tytso, liwang, adilger.kernel; +Cc: yongjun_wei, linux-ext4

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing unlock before return from function ext4_punch_hole()
in the error handling case.
Introduced by commit 1cdec9ca46c2c2a7ce452659f43dac64ad5fbc85.
(ext4: Avoid unnecessarily writing back dirty pages before hole punching)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 fs/ext4/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 2644679..06136b5 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3538,7 +3538,7 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
 	if (ext4_should_order_data(inode)) {
 		ret = ext4_begin_ordered_punch_hole(inode, offset, length);
 		if (ret)
-			return ret;
+			goto out_mutex;
 	}
 
 	/* Now release the pages and zero block aligned part of pages*/


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

* Re: [PATCH -next] ext4: fix missing unlock on error in ext4_punch_hole()
  2013-06-18  3:40 [PATCH -next] ext4: fix missing unlock on error in ext4_punch_hole() Wei Yongjun
@ 2013-06-18 15:05 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2013-06-18 15:05 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: liwang, adilger.kernel, yongjun_wei, linux-ext4

On Tue, Jun 18, 2013 at 11:40:34AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing unlock before return from function ext4_punch_hole()
> in the error handling case.
> Introduced by commit 1cdec9ca46c2c2a7ce452659f43dac64ad5fbc85.
> (ext4: Avoid unnecessarily writing back dirty pages before hole punching)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Hi Wei,

Thanks for pointing this out!  I've folded this patch into the commit
"ext4: avoid unnecessarily writing back dirty pages before hole
punching".

					- Ted

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

end of thread, other threads:[~2013-06-18 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18  3:40 [PATCH -next] ext4: fix missing unlock on error in ext4_punch_hole() Wei Yongjun
2013-06-18 15:05 ` Theodore Ts'o

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).