From: Petr Rockai <prockai@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] let dmeventd unmount invalid snapshots (BZ 189462)
Date: Thu, 21 Oct 2010 00:50:40 +0200 [thread overview]
Message-ID: <877hhc8on3.fsf@twilight.int.mornfall.net.> (raw)
In-Reply-To: <20101007192323.GD22053@agk-dp.fab.redhat.com> (Alasdair G. Kergon's message of "Thu, 7 Oct 2010 20:23:23 +0100")
Hi,
Alasdair G Kergon <agk@redhat.com> writes:
> On Thu, Oct 07, 2010 at 03:10:43PM +0200, Peter Rockai wrote:
>> There are some trade-offs involved. I have opted for using an umount
>> syscall directly since it's simpler and more robust. The downside is
>> that /etc/mtab will go out of sync and people may actually think that
>
> I'm not keen on leaving /etc/mtab out-of-date, or missing out anything
> else that /bin/umount might actually do (with an errored-out device).
> Would this patch need an update to the selinux context to allow umount?
I don't know about selinux. Anyhow, I think my plan is to fork off
/bin/umount asynchronously (i.e. outside of the dmeventd lock). That's
probably the safest possible approach I can think of, at least with our
current design. It will need a bit of thinking, but it should be doable.
>> the snapshot is still mounted (mount(8) just prints mtab without
>> thinking twice about it). We could just fork off umount(8) instead, but
>> that can fail in new and interesting ways.
>
> Yes, even if moved outside the locking. But even umount2() within
> the lock might have deadlock possibilities, as might syslog() as
> you point out.
I will tackle that (syslog) separately.
>> The other possible issue with the patch is that I am not sure whether
>> it's actually safe to read /proc/mounts incrementally, with possibly
>
> kabi found problems like that with another /proc file.
Ok, that arguably sucks. Nevertheless, from reading the kernel code for
that, it seems that while the contents may change in between reads, the
results are still well defined: adding lines to the buffer is done
atomically in the kernel, so we should never get a garbled line. What
could happen is that we encounter the same line twice, or that we miss
something that was there when we were opening the file but was no longer
there when we got to that point in it. Neither should be a serious
problem.
That behaviour depends on the proc file implementation using the
seq_file mechanism, which may not be the case with all files. It is used
for all the mount-related files though (mounts, self/mounts,
self/mountinfo).
Yours,
Petr.
next prev parent reply other threads:[~2010-10-20 22:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 13:51 [PATCH] automatic snapshot extension with dmeventd (BZ 427298) Petr Rockai
2010-10-05 17:44 ` Petr Rockai
2010-10-07 13:10 ` [PATCH] let dmeventd unmount invalid snapshots (BZ 189462) Petr Rockai
2010-10-07 19:23 ` Alasdair G Kergon
2010-10-20 22:50 ` Petr Rockai [this message]
2010-10-29 11:49 ` Petr Rockai
2010-10-29 12:44 ` Petr Rockai
2010-10-29 13:34 ` Zdenek Kabelac
2010-10-14 9:51 ` [PATCH] automatic snapshot extension with dmeventd (BZ 427298) Zdenek Kabelac
2010-10-15 11:57 ` Petr Rockai
2010-10-15 12:55 ` Zdenek Kabelac
2010-10-15 14:15 ` Alasdair G Kergon
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=877hhc8on3.fsf@twilight.int.mornfall.net. \
--to=prockai@redhat.com \
--cc=lvm-devel@redhat.com \
/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.