From patchwork Fri Dec 21 09:19:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 1902511 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D28443FC64 for ; Fri, 21 Dec 2012 09:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751667Ab2LUJSx (ORCPT ); Fri, 21 Dec 2012 04:18:53 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:43282 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751546Ab2LUJSu (ORCPT ); Fri, 21 Dec 2012 04:18:50 -0500 X-IronPort-AV: E=Sophos;i="4.84,330,1355068800"; d="scan'208";a="6447870" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 21 Dec 2012 17:16:55 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id qBL9KWoT026387 for ; Fri, 21 Dec 2012 17:20:32 +0800 Received: from [10.167.225.199] ([10.167.225.199]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012122117174569-552941 ; Fri, 21 Dec 2012 17:17:45 +0800 Message-ID: <50D42998.1010100@cn.fujitsu.com> Date: Fri, 21 Dec 2012 17:19:20 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Linux Btrfs Subject: [PATCH 1/3] Btrfs: fix missing write access release in btrfs_ioctl_resize() X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/21 17:17:45, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/21 17:17:45, Serialize complete at 2012/12/21 17:17:45 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We forget to give up the write access after we find some device operation is going on. Fix it. Signed-off-by: Miao Xie --- fs/btrfs/ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7624212..679b82c 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1338,7 +1338,9 @@ static noinline int btrfs_ioctl_resize(struct file *file, if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running, 1)) { - pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); + pr_info("btrfs: dev add/delete/balance/replace/resize operation" + " in progress\n"); + mnt_drop_write_file(file); return -EINPROGRESS; }