public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Martin Vaeth <martin@mvath.de>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Re: News item review: SquashDelta syncing support
Date: Tue, 19 May 2015 06:36:10 +0000 (UTC)	[thread overview]
Message-ID: <slrnmllmeq.3l8.martin@lounge.imp.fu-berlin.de> (raw)
In-Reply-To: 20150517231009.28903997.dolsen@gentoo.org

Brian Dolbec <dolsen@gentoo.org> wrote:
> Martin Vaeth <martin@mvath.de> wrote:
>>
>> However, currently this does not play nicely with squashdelta:
>> You have to "undo" the mounting of squashdelta and have to use
>> different command (e.g. squashmount) afterwards.
>
> No, that is not correct [...]
> 2) /etc/portage/repo.postsync.d

I know about this hook, but this is not what I meant.

What I meant is the possibility to *replace* the automatic
mounting of portage by a different command (for instance,
a possibility to *avoid* that portage mounts/umounts
automatically but expects this to happens in this hook).

I give reasons for this below.

(This discussion belongs actually to portage-devel mailing
list or to some bug, but now I feel the necessity to clarify
the misunderstanding.)

It is not only inefficient and hackish (with possible problems
in case of unexpected situations like a SIGINT or other signal
at a "bad" time) if two programs/scripts "fight" about mounts
and undo each others' mounts. It also causes severe difficulties
in connection with overlayfs/aufs/...:

With these filesystems, you must create two (in case of
overlayfs even three) auxiliary directories, and in this
situation, it might be natural to choose these as
temporary direcories (e.g. generated in /tmp with unique names);
to understand the following explanation note also that two
of these directories (the squash filesystem and the overlay
filesystem) should "normally" always be mounted/umounted
together.

Now if portage umounts only the "overlay" directory,
the information about the temporary directory names is lost
(leaving possibly quite a bit data in /tmp undeleted
forever), and the second necessary "umount" does not
happen and is hard to do later on: It prevents the
space of the old squash file from actually being freed
(and this mount is hard to find later on: It is a mount
of a deleted file on an unknown temporary directory.
Of course, one could try to find this mount by some heuristic,
but this is extremely hackish, and the heuristic might find
some other squash file which the user has mounted similarly
for some other reason.)

In case of the mentioned "squashmount" tool, the situation
is better, because "squashmount" is rather complex and e.g.
stores/manages the names of temporary directories independently.
However, users might also want to use less sophisticated tools
than "squashmount" (and also "squashmount" has no easy solution
for "random" remounts of the mount points it manages, because
it is almost impossible to write a "generic" such solution.)

In any case, it is rather hackisch to write a lot of additional
code to "undo" an actually undesired umounting+mounting:
The "clean" solution appears to be to not do the "undesired"
(in this situation) umounting+mounting in the first place but
to execute *only* the actually desired (u)mount command(s)
instead.



  reply	other threads:[~2015-05-19  6:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 14:51 [gentoo-dev] News item review: SquashDelta syncing support Michał Górny
2015-05-15 15:23 ` Dirkjan Ochtman
2015-05-15 16:15   ` Diamond
2015-05-15 18:32     ` Ian Stakenvicius
2015-05-15 19:33       ` Rich Freeman
2015-05-15 19:38         ` Ian Stakenvicius
2015-05-18  5:48         ` [gentoo-dev] " Martin Vaeth
2015-05-18  6:10           ` Brian Dolbec
2015-05-19  6:36             ` Martin Vaeth [this message]
2015-05-16 21:59   ` [gentoo-dev] " Michał Górny
2015-05-16 14:59 ` Michael Orlitzky
2015-05-16 18:38   ` Alexis Ballier
2015-05-16 19:18     ` Pacho Ramos
2015-05-16 19:23       ` Michael Orlitzky
2015-05-16 20:34         ` Brian Dolbec
2015-05-16 22:01         ` Michał Górny
2015-05-17  0:38           ` Michael Orlitzky
2015-05-17  3:47             ` Michał Górny
2015-05-17  8:52               ` [gentoo-dev] " Duncan
2015-05-17 18:52               ` [gentoo-dev] " Dale
2015-05-17 19:41               ` Michael Orlitzky
2015-05-20  7:56               ` Marc Schiffbauer
2015-05-16 22:00   ` Michał Górny
2015-05-17  0:45     ` Michael Orlitzky
2015-05-17  8:41       ` [gentoo-dev] " Duncan
2015-05-17 13:51     ` [gentoo-dev] " Ciaran McCreesh
2015-05-16 20:48 ` Alon Bar-Lev
2015-05-16 22:06   ` Michał Górny

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=slrnmllmeq.3l8.martin@lounge.imp.fu-berlin.de \
    --to=martin@mvath.de \
    --cc=gentoo-dev@lists.gentoo.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