From: Josef Bacik <josef@toxicpanda.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
"kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH 1/5] btrfs: unify the ro checking for mount options
Date: Mon, 28 Sep 2020 14:23:15 -0400 [thread overview]
Message-ID: <be964e53-0adb-a829-8057-fe5c9115fe70@toxicpanda.com> (raw)
In-Reply-To: <DM5PR0401MB3591BBA587DD3D36F47FAA549B350@DM5PR0401MB3591.namprd04.prod.outlook.com>
On 9/28/20 8:37 AM, Johannes Thumshirn wrote:
> On 24/09/2020 17:33, Josef Bacik wrote:
>> We're going to be adding more options that require RDONLY, so add a
>> helper to do the check and error out if we don't have RDONLY set.
>>
>> + /* We're read-only, don't have to check. */
>> + if (new_flags & SB_RDONLY)
>> + goto out;
>> +
>
> Why aren't you moving the SB_RDONLY check into the new check_ro_option() as well?
> This is what I would have thought this patch does after just reading the commit message.
>
To avoid the multiple calls if we're not read only, otherwise it'll be multiple
function calls to check that that SB_RDONLY is set. The compiler will probably
optimize that away, but I just went with this instead. I'm good either way if
people have strong opinions one way or the other. Thanks,
Josef
next prev parent reply other threads:[~2020-09-28 18:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 15:32 [PATCH 0/5] New rescue mount options Josef Bacik
2020-09-24 15:32 ` [PATCH 1/5] btrfs: unify the ro checking for " Josef Bacik
2020-09-25 0:36 ` Qu Wenruo
2020-09-28 12:37 ` Johannes Thumshirn
2020-09-28 18:23 ` Josef Bacik [this message]
2020-09-29 6:36 ` Johannes Thumshirn
2020-09-24 15:32 ` [PATCH 2/5] btrfs: push the NODATASUM check into btrfs_lookup_bio_sums Josef Bacik
2020-09-25 0:39 ` Qu Wenruo
2020-09-28 18:28 ` Josef Bacik
2020-09-28 12:39 ` Johannes Thumshirn
2020-09-24 15:32 ` [PATCH 3/5] btrfs: introduce rescue=ignorebadroots Josef Bacik
2020-09-25 0:47 ` Qu Wenruo
2020-09-28 18:24 ` Josef Bacik
2020-09-24 15:32 ` [PATCH 4/5] btrfs: introduce rescue=ignoredatacsums Josef Bacik
2020-09-25 0:50 ` Qu Wenruo
2020-09-24 15:32 ` [PATCH 5/5] btrfs: introduce rescue=all Josef Bacik
2020-09-25 0:51 ` Qu Wenruo
2020-09-25 0:34 ` [PATCH 0/5] New rescue mount options Qu Wenruo
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=be964e53-0adb-a829-8057-fe5c9115fe70@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=kernel-team@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox