From patchwork Wed Apr 17 16:19:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2454501 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 5AADC3FD8C for ; Wed, 17 Apr 2013 16:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965254Ab3DQQTV (ORCPT ); Wed, 17 Apr 2013 12:19:21 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:58892 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965222Ab3DQQTU (ORCPT ); Wed, 17 Apr 2013 12:19:20 -0400 Received: from mx2.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id 9D1569A033F for ; Wed, 17 Apr 2013 10:19:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1366215559; bh=ErVMWZu/JK8AmU5OBVHsnAXue+IHAu+yoYcNUcoMT0s=; h=From:To:Subject:Date; b=D3BHJJJ0i39PwvgbLfmJfZmLTuGhtnB+Z6vZuHksbqli4c/b6YB1oHUeyjfZx2l3v 1kd0nYwWRwBAf4U2XitbUHh9tlq+ZJHVwr0vCW4hmowT8cbwS3Mb6aMJ8o5ZQFvswk ViIT09DIZNZn+x0kAqZjX98Mcfa9ljG6w9MZha9E= X-ASG-Debug-ID: 1366215558-0421b537ab6cb70001-6jHSXT Received: from mail1.int.fusionio.com (mail1.int.fusionio.com [10.101.1.21]) by mx2.fusionio.com with ESMTP id 0XIP91giuBLmgfaL (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 17 Apr 2013 10:19:18 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (76.182.72.146) by mail.fusionio.com (10.101.1.19) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 17 Apr 2013 10:19:18 -0600 From: Josef Bacik To: Subject: [PATCH] Btrfs: fix lockdep warning Date: Wed, 17 Apr 2013 12:19:16 -0400 X-ASG-Orig-Subj: [PATCH] Btrfs: fix lockdep warning Message-ID: <1366215556-8586-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.7.7.6 MIME-Version: 1.0 X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1366215558 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.181:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.128395 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The locking order for stuff is __sb_start_write ordered_mutex but with sync() we don't do __sb_start_write for some strange reason, which means that our iput in wait_ordered_extents could start a transaction which does the __sb_start_write while we're holding the ordered_mutex. Fix this by using delayed iput in sync. Thanks, Reported-by: David Sterba Signed-off-by: Josef Bacik --- fs/btrfs/super.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index bb60fe5..2a0bece 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -866,7 +866,7 @@ int btrfs_sync_fs(struct super_block *sb, int wait) return 0; } - btrfs_wait_ordered_extents(root, 0); + btrfs_wait_ordered_extents(root, 1); trans = btrfs_attach_transaction_barrier(root); if (IS_ERR(trans)) {