linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <Anand.Jain@oracle.com>
To: Jeff Mahoney <jeffm@suse.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>,
	David Sterba <dsterba@suse.cz>,
	Chris Mason <chris.mason@fusionio.com>
Subject: Re: [PATCH] btrfs-progs: canonicalize pathnames for device commands
Date: Wed, 24 Sep 2014 14:33:13 +0800	[thread overview]
Message-ID: <542265A9.6020903@oracle.com> (raw)
In-Reply-To: <5417299F.6040504@oracle.com>


>>> Nice patch. However its better if we do this in the btrfs kernel
>>> function btrfs_scan_one_device(). Since the non-canonicalize path
>>> can still sneak through the btrfs specific mount option "device=".
>>>
>>> Any comments ?
>>
>> My initial reaction is to avoid playing naming names within the
>> kernel. But since it's device mapper-specific, it might not be too
>> messy to do that. In addition to the patch to the progs, we're also
>> carrying a patch to systemd since it has it's own little ioctl wrapper
>> to do the scanning. It needed to be fixed there as well.
>
>   looks like we need to fix systemd as well. As I check systemd is using
>   READY ioctl.


systemd is using device ready ioctl's bug as a feature (if the
comment in systemd is true, as below).

./systemd/rules/64-btrfs.rules
----
# let the kernel know about this btrfs filesystem, and check if it is 
complete
IMPORT{builtin}="btrfs ready $devnode"
----

btrfs dev ready is only to check if the device is ready,
not to let the kernel know about it. the bug part in the
ioctl is it would update the device path, even when the
device is mounted.

Either we need transition the bug as a feature OR fix the bug.

-Anand



      reply	other threads:[~2014-09-24  6:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 20:43 [PATCH] btrfs-progs: canonicalize pathnames for device commands Jeff Mahoney
2014-06-18 16:32 ` David Sterba
2014-09-13  7:31 ` Anand Jain
2014-09-14 22:47   ` Jeff Mahoney
2014-09-15 18:02     ` Anand Jain
2014-09-24  6:33       ` Anand Jain [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=542265A9.6020903@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=chris.mason@fusionio.com \
    --cc=dsterba@suse.cz \
    --cc=jeffm@suse.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;
as well as URLs for NNTP newsgroup(s).