From: Karel Zak <kzak@redhat.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Milan Broz <mbroz@redhat.com>,
util-linux-ng@vger.kernel.org, linux-kernel@vger.kernel.org,
axboe@kernel.dk
Subject: Re: [PATCH] loop: add some basic read-only sysfs attributes
Date: Thu, 29 Jul 2010 21:56:16 +0200 [thread overview]
Message-ID: <20100729195616.GF1981@nb.net.home> (raw)
In-Reply-To: <AANLkTinq4TUobEwnfpMFAkCugTokSZ-8KQ-ryuv6jXCc@mail.gmail.com>
On Thu, Jul 29, 2010 at 06:07:31PM +0200, Kay Sievers wrote:
> On Thu, Jul 29, 2010 at 16:58, Karel Zak <kzak@redhat.com> wrote:
> > On Thu, Jul 29, 2010 at 04:22:50PM +0200, Kay Sievers wrote:
> >> On Thu, Jul 29, 2010 at 16:06, Milan Broz <mbroz@redhat.com> wrote:
> >> > On 07/29/2010 03:47 PM, Kay Sievers wrote:
> >> >> On Thu, Jul 29, 2010 at 15:33, Milan Broz <mbroz@redhat.com> wrote:
> >> >>> Create /sys/block/loopX/loop directory and provide these attributes:
> >> >>> - backing_file
> >> >>> - autoclear
> >> >>> - offset
> >> >>> - sizelimit
> >> >>>
> >> >>> To be used in util-linux-ng (and possibly elsewhere like udev rules)
> >> >>> where code need to get loop attributes from kernel (and not store
> >> >>> duplicate info in userspace).
> >> >>
> >> >> Isn't it that the loop attributes are created _after_ the loopdev is
> >> >> registered? That would make it hard to use these attributes from udev,
> >> >> as the event is already running while they are created.
> >> >
> >> > First 8 loop devices are registered always (without backing file),
> >> > so you have wait for change event initiated from fd set ioctl anyway...
> >> > (backing file attribute is empty in that case)
> >>
> >> Ah, so we are sure, we always get a 'change' event, and before that,
> >> none of these values are ever useful to read? I mean, there will not
> >> be attributes that are interesting during an 'add' event?
> >
> > I think the patch does not change the current behavior. It exports
> > details about loopdevs to userspace by /sys. This is the primary goal
> > of the patch.
>
> Sure it does. Sysfs attributes need to be created _before_ uevents are
> sent out. The current behavior is that all blockdev attributes are
> safely created before the event is sent. These loop attributes are
> created _after_ the event is sent.
>
> The question is if we can rely on the fact, that 'add' events never
> want to look at any of these attributes, and all can be deferred to
I think we can rely on this fact, 'add' does not mean that the device
is ready. BTW, why there is /sys/block/loopN at all if the device
is not associated with any backing file?
Note that /sys/block/loopN/ro is there for years and depends on
backing file as well (so it's useless after "add").
> later 'change' events. If we can't be fully certain about this, this
> stuff must be changed to happen before the event for the blockdev is
> sent out.
The primary goal is to use the attributes in mount(8) and losetup(8). I
have doubts that we will use it udev rules.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2010-07-29 19:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100722101541.GU15652@nb.net.home>
2010-07-29 13:33 ` [PATCH] loop: add some basic read-only sysfs attributes Milan Broz
2010-07-29 13:47 ` Kay Sievers
2010-07-29 14:06 ` Milan Broz
2010-07-29 14:22 ` Kay Sievers
2010-07-29 14:35 ` Milan Broz
2010-07-29 14:58 ` Karel Zak
2010-07-29 16:07 ` Kay Sievers
2010-07-29 19:56 ` Karel Zak [this message]
2010-07-29 20:06 ` Karel Zak
2010-07-29 20:24 ` Milan Broz
2010-07-30 4:36 ` Kay Sievers
2010-07-30 14:22 ` [PATCH v2] " Milan Broz
2010-07-30 14:34 ` Kay Sievers
2010-08-23 12:29 ` Karel Zak
2010-08-23 12:30 ` Jens Axboe
2010-07-30 7:37 ` [PATCH] " Karel Zak
2010-07-30 7:43 ` Kay Sievers
2010-07-30 8:01 ` Kay Sievers
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=20100729195616.GF1981@nb.net.home \
--to=kzak@redhat.com \
--cc=axboe@kernel.dk \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbroz@redhat.com \
--cc=util-linux-ng@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.