From patchwork Tue Jun 18 03:40:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 252104 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5E8B02C0174 for ; Tue, 18 Jun 2013 13:40:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754157Ab3FRDkg (ORCPT ); Mon, 17 Jun 2013 23:40:36 -0400 Received: from mail-bk0-f47.google.com ([209.85.214.47]:38720 "EHLO mail-bk0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753973Ab3FRDkf (ORCPT ); Mon, 17 Jun 2013 23:40:35 -0400 Received: by mail-bk0-f47.google.com with SMTP id jg1so1520676bkc.34 for ; Mon, 17 Jun 2013 20:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=vvREUwxv14CIoGYXVJxGKm9Q3/y97LtHRymN1jeXUt8=; b=bcVFtKWndHaJhdWtwMKJLcQw9oTy2YfGIh8QHaLXf78Vg99aCIuEOgnTIlOyKW/D5m szMW2xp9pHVbCiUmTdY4AEW2FvNBx5gUfRovqBCGrXWtoLVX3cr6B7Q7AXDygLhmKuFC jY+ivhk/8y7Sz7cFLoRuZTHVZXxxwyxVztVOdbE94DaiK84GQvcoLJc3eMWT+nU+T6TN a/g7qqHkJmdIXL8zgEnqN/kxvM6e6ZAw3BEfdQV2n+WWC9GPsAq0UNkxAhajASPJQJAm mNIgRt1bShujMzF0nOFumxD1rOQZV3TI6Utzc5tNwPjPGyKM+PuxQ8doiRKIZ1XYbIiQ Oh4Q== MIME-Version: 1.0 X-Received: by 10.204.191.72 with SMTP id dl8mr2329205bkb.56.1371526834623; Mon, 17 Jun 2013 20:40:34 -0700 (PDT) Received: by 10.204.39.1 with HTTP; Mon, 17 Jun 2013 20:40:34 -0700 (PDT) Date: Tue, 18 Jun 2013 11:40:34 +0800 Message-ID: Subject: [PATCH -next] ext4: fix missing unlock on error in ext4_punch_hole() From: Wei Yongjun To: tytso@mit.edu, liwang@ubuntukylin.com, adilger.kernel@dilger.ca Cc: yongjun_wei@trendmicro.com.cn, linux-ext4@vger.kernel.org Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Wei Yongjun 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 --- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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*/