public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: isar-users@googlegroups.com
Subject: Re: [PATCH] isar-image-base: fix some dangling mounts
Date: Mon, 13 Nov 2017 17:47:51 +0300	[thread overview]
Message-ID: <176ee2a2-7f5b-8395-80c8-ca4df6ecf952@ilbers.de> (raw)
In-Reply-To: <20171113142443.hczmlzhnlligt62m@MD1KR9XC.ww002.siemens.net>

On 11/13/2017 05:24 PM, Christian Storm wrote:
>> [...]
>> Here I see that you insert quite similar patterns across the Isar code,
>> would it be better to have one global clean up function like?
>>
>> do_isar_mount_cleanup () {
>>       if [ -d "${WORKDIR}/mnt" ]; then
>>           # umount and remove
>>       fi
>>
>>       if [ -d "${WORKDIR}/rootfs/proc" ]; then
>>           # umount and remove
>>       fi
>>
>>       if [ -d "${BUILDCHROOT_DIR}/proc" ]; then
>>           # umount and remove
>>       fi
>>
>>       etc...
>> }
>>
>> This approach will significantly simplify maintenance of clean up traps
>> and adding of new possible mounts to Isar. What do you think?
> 
> I'd say it depends :)
> It breaks if you rely on keeping something mounted while executing a
> child script that does unmount everything, following your proposal. If
> we can make sure that such a situation never occurs, we may consolidate
> this. For now, it's rather local just undoing the mounts done in the
> scope of the script.
> So, in the end, I think it's a matter of taste and contracts between the
> different parts of Isar.
> 

Ok.

> What one may consider to "de-duplicate" is a stack of mounted directories
> being pushed to and unmounted on script exit. So, something like
>    push_umount ${IMAGE_ROOTFS}/proc
> and then the EXIT trap enumerates all those entries, unmounting them.
> The same has to be done for removing the directories, if applicable.

This sounds reasonable, will try to implement this?

BTW: for me it's not the point for me to block current patch, it'd be 
very helpful to have it in the tree now.

Alex

  reply	other threads:[~2017-11-13 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 12:22 Christian Storm
2017-11-13 12:50 ` Alexander Smirnov
2017-11-13 12:57   ` Christian Storm
2017-11-13 13:53 ` Alexander Smirnov
2017-11-13 14:24   ` Christian Storm
2017-11-13 14:47     ` Alexander Smirnov [this message]
2017-11-14  7:36       ` Christian Storm
2017-11-14  7:48         ` Alexander Smirnov
2017-11-14  8:58           ` Christian Storm
2017-11-13 13:57 ` Henning Schild
2017-11-14 16:01 ` Alexander Smirnov

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=176ee2a2-7f5b-8395-80c8-ca4df6ecf952@ilbers.de \
    --to=asmirnov@ilbers.de \
    --cc=isar-users@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox