From patchwork Mon Jun 13 05:50:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 873922 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5D5qnaj024967 for ; Mon, 13 Jun 2011 05:52:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752122Ab1FMFvV (ORCPT ); Mon, 13 Jun 2011 01:51:21 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:53819 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754Ab1FMFvV (ORCPT ); Mon, 13 Jun 2011 01:51:21 -0400 Received: from m2.gw.fujitsu.co.jp (unknown [10.0.50.72]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 449553EE0C0 for ; Mon, 13 Jun 2011 14:51:19 +0900 (JST) Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 29F8E45DF2B for ; Mon, 13 Jun 2011 14:51:19 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 127BB45DD73 for ; Mon, 13 Jun 2011 14:51:19 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 039611DB803C for ; Mon, 13 Jun 2011 14:51:19 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.240.81.145]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id C64641DB8038 for ; Mon, 13 Jun 2011 14:51:18 +0900 (JST) Received: from m105.css.fujitsu.com (m105 [127.0.0.1]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id 9799A5D8002; Mon, 13 Jun 2011 14:51:18 +0900 (JST) Received: from T-ITOH1.jp.fujitsu.com (unknown [10.124.101.84]) by m105.s.css.fujitsu.com (Postfix) with SMTP id 328205D8001; Mon, 13 Jun 2011 14:51:18 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.4.0 Received: from T-ITOH1[10.124.101.84] by T-ITOH1 (FujitsuOutboundMailChecker v1.4.0/9992[10.124.101.84]); Mon, 13 Jun 2011 14:50:47 +0900 (JST) Message-Id: <201106130550.AA00025@T-ITOH1.jp.fujitsu.com> From: Tsutomu Itoh Date: Mon, 13 Jun 2011 14:50:34 +0900 To: linux-btrfs@vger.kernel.org Cc: chris.mason@oracle.com Subject: [PATCH] Btrfs: turn to readonly when btrfs_start_ioctl_transaction() fails MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Jun 2011 05:52:50 +0000 (UTC) When btrfs_start_ioctl_transaction() fails, we should call btrfs_std_error() properly for filesystem to readonly. Signed-off-by: Tsutomu Itoh --- This patch needs btrfs_abort_transaction function. fs/btrfs/ioctl.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b793d11..119a126 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2498,8 +2498,10 @@ static long btrfs_ioctl_trans_start(struct file *file) ret = -ENOMEM; trans = btrfs_start_ioctl_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, ret); goto out_drop; + } file->private_data = trans; return 0;