Linux filesystem development
 help / color / mirror / Atom feed
* d_path() results in presence of detached mounts
@ 2025-04-07 16:00 Jan Kara
  2025-04-08  8:55 ` Christian Brauner
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2025-04-07 16:00 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Christian Brauner, mkoutny

Hello!

Recently I've got a question from a user about the following:

# unshare --mount swapon /dev/sda3
# cat /proc/swaps
Filename                                Type            Size            Used            Priority
/sda3                                   partition       2098152         0               -2

Now everything works as expected here AFAICS. When namespace gets created
/dev mount is cloned into it. When swapon exits, the namespace is
destroyed and /dev mount clone is detached (no parent, namespace NULL).
Hence when d_path() crawls the path it stops at the mountpoint root and
exits. There's not much we can do about this but when discussing the
situation internally, Michal proposed that d_path() could append something
like "(detached)" to the path string - similarly to "(deleted)". That could
somewhat reduce the confusion about such paths? What do people think about
this?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2025-04-08 12:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 16:00 d_path() results in presence of detached mounts Jan Kara
2025-04-08  8:55 ` Christian Brauner
2025-04-08 11:39   ` Christian Brauner
2025-04-08 12:04     ` Jan Kara
2025-04-08 12:44       ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox