All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [RESEND PATCH 1/3] btrfs: wrap rdonly check into btrfs_fs_is_rdonly
Date: Tue, 7 Jun 2022 15:45:31 +0530	[thread overview]
Message-ID: <95980806-b198-d75e-d50c-0c18486da9a6@oracle.com> (raw)
In-Reply-To: <PH0PR04MB7416C47B4A55666510F7FDAA9BA19@PH0PR04MB7416.namprd04.prod.outlook.com>

On 6/3/22 14:13, Johannes Thumshirn wrote:
> On 03.06.22 04:04, Anand Jain wrote:
>> +static inline bool btrfs_fs_is_rdonly(const struct btrfs_fs_info *fs_info)
>> +{
>> +	bool rdonly = sb_rdonly(fs_info->sb);
>> +	bool fs_rdonly = test_bit(BTRFS_FS_STATE_RO, &fs_info->fs_state);
>> +
>> +	BUG_ON(rdonly != fs_rdonly);
>> +
>> +	return rdonly;
>> +}
> 
> 
> Do we really need a BUG_ON() here or can we make it an ASSERT()?


These two rdonly verification methods should match, but we have never 
verified them. When this is through a few revisions, we can just remove 
it instead. I suggest we keep BUG_ON() a couple of revisions.

Thanks, Anand

> 
> Apart from that
> 
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>


  reply	other threads:[~2022-06-07 10:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03  1:42 [RESEND PATCH 0/3] cleanup rdonly flag and BTRFS_FS_OPEN flag Anand Jain
2022-06-03  1:42 ` [RESEND PATCH 1/3] btrfs: wrap rdonly check into btrfs_fs_is_rdonly Anand Jain
2022-06-03  8:43   ` Johannes Thumshirn
2022-06-07 10:15     ` Anand Jain [this message]
2022-06-07 13:30       ` Johannes Thumshirn
2022-06-21 17:10   ` David Sterba
2022-06-03  1:42 ` [RESEND PATCH 2/3] btrfs: wrap check for BTRFS_FS_OPEN flag into function Anand Jain
2022-06-03  1:42 ` [RESEND PATCH 3/3] btrfs: set BTRFS_FS_OPEN flag for both rdonly and rw Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95980806-b198-d75e-d50c-0c18486da9a6@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.