From patchwork Tue Oct 10 10:48:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pandit X-Patchwork-Id: 9995797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E02C5603B5 for ; Tue, 10 Oct 2017 10:54:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D455A283F9 for ; Tue, 10 Oct 2017 10:54:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C65F528403; Tue, 10 Oct 2017 10:54:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D030283F9 for ; Tue, 10 Oct 2017 10:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755157AbdJJKya (ORCPT ); Tue, 10 Oct 2017 06:54:30 -0400 Received: from mx2.mpynet.fi ([82.197.21.85]:19489 "EHLO mx2.mpynet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbdJJKya (ORCPT ); Tue, 10 Oct 2017 06:54:30 -0400 X-Greylist: delayed 382 seconds by postgrey-1.27 at vger.kernel.org; Tue, 10 Oct 2017 06:54:29 EDT Date: Tue, 10 Oct 2017 13:48:05 +0300 From: Rakesh Pandit To: , CC: David Sterba , Josef Bacik , Chris Mason Subject: [PATCH] btrfs: use appropriate replacements for __sb_{start,end}_write calls Message-ID: <20171010104803.GA33133@dhcp-216.srv.tuxera.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-ClientProxiedBy: tuxera-exch.ad.tuxera.com (10.20.48.11) To tuxera-exch.ad.tuxera.com (10.20.48.11) Received-SPF: none Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit a53f4f8e9c8eb ("btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.") started using internal calls and we replace them with more suitable ones. Signed-off-by: Rakesh Pandit Reviewed-by: Nikolay Borisov --- fs/btrfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 35a128a..99c21ae 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1205,8 +1205,8 @@ int btrfs_sync_fs(struct super_block *sb, int wait) * happens. The pending operations are delayed to the * next commit after thawing. */ - if (__sb_start_write(sb, SB_FREEZE_WRITE, false)) - __sb_end_write(sb, SB_FREEZE_WRITE); + if (sb_start_write_trylock(sb)) + sb_end_write(sb) else return 0; trans = btrfs_start_transaction(root, 0);