From patchwork Wed Dec 6 15:13:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konstantin Komarov X-Patchwork-Id: 174634 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4171929vqy; Wed, 6 Dec 2023 07:13:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5L46rKFCqaeazzrEkVoxnz2+wvxeRKXH91dOvxGcI2Yd0SvndZXFfOHD+ytDvZXoul5sx X-Received: by 2002:a17:90b:11cc:b0:286:da5e:a4fb with SMTP id gv12-20020a17090b11cc00b00286da5ea4fbmr808242pjb.90.1701875638099; Wed, 06 Dec 2023 07:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701875638; cv=none; d=google.com; s=arc-20160816; b=gd4TOQKgWWGlMY/exwwHmjFOt+BHWUUNpvBVOrJymVMrDpDBZlxSvtstq2Kh+IwSiH pPeUvjt+njxat5aKWsvJew7DAR5XPIy51ljO1ildWqSK6RMYPWn/yE8uxnv8rO5KNlm0 Qw2ZzQbSkfF4U+pkEClnpKGqhpEfC7IKMVG/Td2A3NLD0mwe4k14PQu1+TV7ZAwQx7cZ sdk2HAFCFS6ChyFRwcq51lS+7VhZmPw72V1EEPQSztyBAsrP67D9gaIChycSydixKenb vjQkZNfBEf5QpMgHLHo2lBf15qnsUIyKJbUSZEtJmJKiW1238dkUwZKzTWxXvBoVo7Iw sjFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=CUZk88fabksVMQIwptkfOhP6XsgOcXbEpcc4odQSDSQ=; fh=P7I85FIabZcM8ojWdeG8ABpTZepe/Xtte9jKWDfUHBM=; b=dDNe0qfjHM8FCqy3d4LUmXa70FnZ8Au0umVYiqfxvwQ5oXJOgFbz9QkPrKrDO1gqJd OeEDJJbfra4cEfar4e1IclWju2pPP/BWr4L4eBBN4amKp52DDIVNdZg0cjDDfIMWqV7h EicT2WtH7BXzi/9UxPaB6D2PKMAy5ZyUft8EKY9gCBjjU37PTUyu+gSp1h2n0DuR8lEH CxIzl6DkRSW9+c9yQpnwyjg7a1WIrsn/SF9vZmBLNQ6yBU/BI3zndHyNOdzrnFTolid/ +Pj/49rvl4vNox5+i/Ui3oDt2JOMG4rFPqXuEztY+2mFewUMCvFE38G6PcSdSaq9DP5m JhCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=NCK6bfmA; dkim=pass header.i=@paragon-software.com header.s=mail header.b=cKTfILwv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id hb18-20020a17090b209200b00286edd97032si2469708pjb.134.2023.12.06.07.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:13:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=NCK6bfmA; dkim=pass header.i=@paragon-software.com header.s=mail header.b=cKTfILwv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E023080294A1; Wed, 6 Dec 2023 07:13:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442448AbjLFPNo (ORCPT + 99 others); Wed, 6 Dec 2023 10:13:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442472AbjLFPNn (ORCPT ); Wed, 6 Dec 2023 10:13:43 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FBC0B5; Wed, 6 Dec 2023 07:13:49 -0800 (PST) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 216141E1A; Wed, 6 Dec 2023 15:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1701875243; bh=CUZk88fabksVMQIwptkfOhP6XsgOcXbEpcc4odQSDSQ=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=NCK6bfmAVok0RLfrG2qNu60LQBlIyV8PnwhtGpjL8OHnbfVEi3NJ4VX370Q1e5hk3 HOzmdUxENLGFoCwvBzdk7CzHTnC0QkqbXH/Uig2v9kOtjc8kTdItbUuJFx9ZVhn1V6 awSW+hE0eS335PqIP4VtGv0WlMxfI8F7ZdrLM6YU= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 64E4B2117; Wed, 6 Dec 2023 15:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1701875627; bh=CUZk88fabksVMQIwptkfOhP6XsgOcXbEpcc4odQSDSQ=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=cKTfILwvtBLLE19pwq14wyqj1avYe8W/4CiDi8l/6aJTt4VI1IVYevoAo22826ksJ ROfjf2aOvncNloeosyx2+MUuiP2wVYUZC88epJYNhDB5WBuYiKNKTKnqQBeu/gg51w R0UbWXrBWjm1M6WFpRGa90JZRnpvbf+JG4wMctg4= Received: from [172.16.192.129] (192.168.211.144) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 6 Dec 2023 18:13:46 +0300 Message-ID: <6e9cc7e7-b29c-4d63-a73c-9aadd1589f18@paragon-software.com> Date: Wed, 6 Dec 2023 18:13:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 13/16] fs/ntfs3: ntfs3_forced_shutdown use int instead of bool Content-Language: en-US From: Konstantin Komarovc To: CC: , References: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> In-Reply-To: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> X-Originating-IP: [192.168.211.144] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 06 Dec 2023 07:13:54 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784545949246694987 X-GMAIL-MSGID: 1784545949246694987 Signed-off-by: Konstantin Komarov ---  fs/ntfs3/fsntfs.c  | 3 ++-  fs/ntfs3/ntfs_fs.h | 6 +++---  fs/ntfs3/super.c   | 2 +-  3 files changed, 6 insertions(+), 5 deletions(-)  /* diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index fbfe21dbb425..350461d8cece 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -853,7 +853,8 @@ void ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)      /*       * sb can be NULL here. In this case sbi->flags should be 0 too.       */ -    if (!sb || !(sbi->flags & NTFS_FLAGS_MFTMIRR)) +    if (!sb || !(sbi->flags & NTFS_FLAGS_MFTMIRR) || +        unlikely(ntfs3_forced_shutdown(sb)))          return;      blocksize = sb->s_blocksize; diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index d40bc7669ae5..7510875efef6 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -62,7 +62,7 @@ enum utf16_endian;  /* sbi->flags */  #define NTFS_FLAGS_NODISCARD        0x00000001  /* ntfs in shutdown state. */ -#define NTFS_FLAGS_SHUTDOWN        0x00000002 +#define NTFS_FLAGS_SHUTDOWN_BIT        0x00000002  /* == 4*/  /* Set when LogFile is replaying. */  #define NTFS_FLAGS_LOG_REPLAYING    0x00000008  /* Set when we changed first MFT's which copy must be updated in $MftMirr. */ @@ -1001,9 +1001,9 @@ static inline struct ntfs_sb_info *ntfs_sb(struct super_block *sb)      return sb->s_fs_info;  } -static inline bool ntfs3_forced_shutdown(struct super_block *sb) +static inline int ntfs3_forced_shutdown(struct super_block *sb)  { -    return test_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flags); +    return test_bit(NTFS_FLAGS_SHUTDOWN_BIT, &ntfs_sb(sb)->flags);  }  /* diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index af8521a6ed95..65ef4b57411f 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -719,7 +719,7 @@ static int ntfs_show_options(struct seq_file *m, struct dentry *root)   */  static void ntfs_shutdown(struct super_block *sb)  { -    set_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flags); +    set_bit(NTFS_FLAGS_SHUTDOWN_BIT, &ntfs_sb(sb)->flags);  }