From: Johannes Kimmel <kernel@bareminimum.eu>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org, clm@fb.com, josef@toxicpanda.com,
dsterba@suse.com, linux-kernel@vger.kernel.org,
Calvin Walton <calvin.walton@kepstin.ca>
Subject: Re: [PATCH] btrfs: correctly escape subvol in btrfs_show_options
Date: Sat, 22 Mar 2025 11:15:19 +0100 [thread overview]
Message-ID: <36c6c8f3-d7fb-42b8-bafe-4eae9b02f4ec@bareminimum.eu> (raw)
In-Reply-To: <20250319235251.GS32661@twin.jikos.cz>
On 20.03.25 00:52, David Sterba wrote:
> On Wed, Mar 19, 2025 at 10:49:00PM +0100, Johannes Kimmel wrote:
>> Currently, displaying the btrfs subvol mount option doesn't escape `,`.
>> This makes parsing /proc/self/mounts and /proc/self/mountinfo
>> ambigious for subvolume names that contain commas. The text after the
>> comma could be mistaken for another option (think "subvol=foo,ro", where
>> ro is actually part of the subvolumes name).
>
> The subvol= option was intentionally last so the path does not mix with
> other options but yeah it still can be confused if it's parsed in a
> generic way and not assuming anything about the ordering.
>
> I've checked util-linux/libmount, seems that it understands the "\," as
> part of the option value so it should not break anything.
>
>> This patch replaces the manual escape characters list with a call to
>> seq_show_option. Thanks to Calvin Walton for suggesting this approach.
>>
>> Fixes: c8d3fe028f64 ("Btrfs: show subvol= and subvolid= in /proc/mounts")
>> Suggested-by: Calvin Walton <calvin.walton@kepstin.ca>
>> Signed-off-by: Johannes Kimmel <kernel@bareminimum.eu>
>
> Added to for-next, thanks.
Thank you for taking care of this so quickly.
prev parent reply other threads:[~2025-03-22 10:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 21:49 [PATCH] btrfs: correctly escape subvol in btrfs_show_options Johannes Kimmel
2025-03-19 23:52 ` David Sterba
2025-03-22 10:15 ` Johannes Kimmel [this message]
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=36c6c8f3-d7fb-42b8-bafe-4eae9b02f4ec@bareminimum.eu \
--to=kernel@bareminimum.eu \
--cc=calvin.walton@kepstin.ca \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@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