All of lore.kernel.org
 help / color / mirror / Atom feed
* Unmounting lower filesystem while overlayfs uses it
@ 2016-03-10 19:48 Goldwyn Rodrigues
  2016-03-10 22:22 ` Goldwyn Rodrigues
  2016-03-10 23:43 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Goldwyn Rodrigues @ 2016-03-10 19:48 UTC (permalink / raw)
  To: linux-unionfs

Hi,

I noticed that you can continue using overlayfs while the underlying 
filesystem is unmounted. While overlayfs continues to use and show the 
entries from the underlying filesystem. Howerver, /proc/mounts is 
missing the lowerdir mount entry. This could be pretty confusing for 
users (say for example for users looking to hot swap devices)

I traced it down to the vfs mount point being copied/cloned as opposed 
to using the original one. Is there a reason why a new vfsmount is used 
as opposed to using the lowerdir's vfsmount? Perhaps I did not look hard 
enough, but I did not find any changes being made to the cloned lowerdir 
vfsmount.

-- 
Goldwyn

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unmounting lower filesystem while overlayfs uses it
  2016-03-10 19:48 Unmounting lower filesystem while overlayfs uses it Goldwyn Rodrigues
@ 2016-03-10 22:22 ` Goldwyn Rodrigues
  2016-03-10 23:43 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Goldwyn Rodrigues @ 2016-03-10 22:22 UTC (permalink / raw)
  To: linux-unionfs



On 03/10/2016 01:48 PM, Goldwyn Rodrigues wrote:
> Hi,
>
> I noticed that you can continue using overlayfs while the underlying
> filesystem is unmounted. While overlayfs continues to use and show the
> entries from the underlying filesystem. Howerver, /proc/mounts is
> missing the lowerdir mount entry. This could be pretty confusing for
> users (say for example for users looking to hot swap devices)
>
> I traced it down to the vfs mount point being copied/cloned as opposed
> to using the original one. Is there a reason why a new vfsmount is used
> as opposed to using the lowerdir's vfsmount? Perhaps I did not look hard
> enough, but I did not find any changes being made to the cloned lowerdir
> vfsmount.

I found the changes to cloned vfsmount: MS_RDONLY flag.
So, we would have to preserve the stack[].mnt [from ovl_fill_super()] 
variables in ovl_fs and perform the mntput() in ovl_put_super()/ Is that 
okay?


-- 
Goldwyn

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unmounting lower filesystem while overlayfs uses it
  2016-03-10 19:48 Unmounting lower filesystem while overlayfs uses it Goldwyn Rodrigues
  2016-03-10 22:22 ` Goldwyn Rodrigues
@ 2016-03-10 23:43 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2016-03-10 23:43 UTC (permalink / raw)
  To: Goldwyn Rodrigues; +Cc: linux-unionfs

On Thu, Mar 10, 2016 at 01:48:12PM -0600, Goldwyn Rodrigues wrote:
> Hi,
> 
> I noticed that you can continue using overlayfs while the underlying
> filesystem is unmounted. While overlayfs continues to use and show the
> entries from the underlying filesystem. Howerver, /proc/mounts is missing
> the lowerdir mount entry. This could be pretty confusing for users (say for
> example for users looking to hot swap devices)
> 
> I traced it down to the vfs mount point being copied/cloned as opposed to
> using the original one. Is there a reason why a new vfsmount is used as
> opposed to using the lowerdir's vfsmount? Perhaps I did not look hard
> enough, but I did not find any changes being made to the cloned lowerdir
> vfsmount.

There are all sorts of way that users can get confused about which
devices are mounted or not.  For example, if you are using mount
namespaces, just because it is unmounted in *your* namespace doesn't
mean that it isn't still mounted in some other processes's namespace.

I've had at least one bug report from a Debian user when some random
application program happened to use create its own mount namespace,
and then when the user unmounted the file system in the normal
(default) namespace, the file system was still mounted in the
namespace of this daemon, and the file system only got unmounted when
the daemon shut down (and released the namespace).

So this is a much bigger problem than just one that shows up in
unionfs or overlayfs.  It's similar to the issue where a program is
holding an open file descriptor on a large file, and the system
administrators gets confused space dossn't get reclaimed after he
deletes the file.  We don't currently have the equivalent of "lsof"
for mounts, but it should be possible to create such a thing.

					- Ted
					

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-10 23:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 19:48 Unmounting lower filesystem while overlayfs uses it Goldwyn Rodrigues
2016-03-10 22:22 ` Goldwyn Rodrigues
2016-03-10 23:43 ` Theodore Ts'o

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.