From patchwork Tue Oct 19 22:22:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 266601 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9JMMQlF007367 for ; Tue, 19 Oct 2010 22:22:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755259Ab0JSWWW (ORCPT ); Tue, 19 Oct 2010 18:22:22 -0400 Received: from cobra.newdream.net ([66.33.216.30]:48493 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754479Ab0JSWWU (ORCPT ); Tue, 19 Oct 2010 18:22:20 -0400 Received: from localhost.localdomain (dhcp-63-161.cse.ucsc.edu [128.114.63.161]) by cobra.newdream.net (Postfix) with ESMTPA id 69AE8BC670; Tue, 19 Oct 2010 15:25:15 -0700 (PDT) From: Sage Weil To: linux-btrfs@vger.kernel.org Cc: Sage Weil Subject: [PATCH 3/3] Btrfs: fix lockdep warning on clone ioctl Date: Tue, 19 Oct 2010 15:22:12 -0700 Message-Id: <1287526932-28369-4-git-send-email-sage@newdream.net> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1287526932-28369-1-git-send-email-sage@newdream.net> References: <1287526932-28369-1-git-send-email-sage@newdream.net> 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Oct 2010 22:22:27 +0000 (UTC) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index f4a3dde..3f27529 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1502,11 +1502,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, path->reada = 2; if (inode < src) { - mutex_lock(&inode->i_mutex); - mutex_lock(&src->i_mutex); + mutex_lock_nested(&inode->i_mutex, I_MUTEX_PARENT); + mutex_lock_nested(&src->i_mutex, I_MUTEX_CHILD); } else { - mutex_lock(&src->i_mutex); - mutex_lock(&inode->i_mutex); + mutex_lock_nested(&src->i_mutex, I_MUTEX_PARENT); + mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD); } /* determine range to clone */