linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"brauner@kernel.org" <brauner@kernel.org>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	"idryomov@gmail.com" <idryomov@gmail.com>,
	Patrick Donnelly <pdonnell@redhat.com>,
	Alex Markuze <amarkuze@redhat.com>,
	Pavan Rallabhandi <Pavan.Rallabhandi@ibm.com>,
	Greg Farnum <gfarnum@ibm.com>
Subject: [RFC] ceph: strange mount/unmount behavior
Date: Mon, 25 Aug 2025 21:53:48 +0000	[thread overview]
Message-ID: <b803da9f0591b4f894f60906d7804a4181fd7455.camel@ibm.com> (raw)

Hello,

I am investigating an issue with generic/604:

sudo ./check generic/604
FSTYP         -- ceph
PLATFORM      -- Linux/x86_64 ceph-0005 6.17.0-rc1+ #29 SMP PREEMPT_DYNAMIC Mon
Aug 25 13:06:10 PDT 2025
MKFS_OPTIONS  -- 192.168.1.213:6789:/scratch
MOUNT_OPTIONS -- -o name=admin 192.168.1.213:6789:/scratch /mnt/cephfs/scratch

generic/604 10s ... - output mismatch (see
XFSTESTS/xfstestsdev/results//generic/604.out.bad)
    --- tests/generic/604.out	2025-02-25 13:05:32.515668548 -0800
    +++ XFSTESTS/xfstests-dev/results//generic/604.out.bad	2025-08-25
14:25:49.256780397 -0700
    @@ -1,2 +1,3 @@
     QA output created by 604
    +umount: /mnt/cephfs/scratch: target is busy.
     Silence is golden
    ...
    (Run 'diff -u XFSTESTS/xfstests-dev/tests/generic/604.out XFSTESTS/xfstests-
dev/results//generic/604.out.bad'  to see the entire diff)
Ran: generic/604
Failures: generic/604
Failed 1 of 1 tests

As far as I can see, the generic/604 intentionally delays the unmount and mount
operation starts before unmount finish:

# For overlayfs, avoid unmounting the base fs after _scratch_mount tries to
# mount the base fs.  Delay the mount attempt by a small amount in the hope
# that the mount() call will try to lock s_umount /after/ umount has already
# taken it.
$UMOUNT_PROG $SCRATCH_MNT &
sleep 0.01s ; _scratch_mount
wait

As a result, we have this issue because a mnt_count is bigger than expected one
in propagate_mount_busy() [1]:

	} else {
		smp_mb(); // paired with __legitimize_mnt()
		shrink_submounts(mnt);
		retval = -EBUSY;
		if (!propagate_mount_busy(mnt, 2)) {
			umount_tree(mnt, UMOUNT_PROPAGATE|UMOUNT_SYNC);
			retval = 0;
		}
	}


[   71.347372] pid 3762 do_umount():2022 finished:  mnt_get_count(mnt) 3

But if I am trying to understand what is going on during mount, then I can see
that I can mount the same file system instance multiple times even for the same
mount point:

192.168.1.195:6789,192.168.1.212:6789,192.168.1.213:6789:/ on /mnt/cephfs type
ceph (rw,relatime,name=admin,secret=<hidden>,fsid=31977b06-8cdb-42a9-97ad-
d6a7d59a42dd,acl,mds_namespace=cephfs)
192.168.1.195:6789,192.168.1.212:6789,192.168.1.213:6789:/ on /mnt/TestCephFS
type ceph (rw,relatime,name=admin,secret=<hidden>,fsid=31977b06-8cdb-42a9-97ad-
d6a7d59a42dd,acl,mds_namespace=cephfs)
192.168.1.195:6789,192.168.1.212:6789,192.168.1.213:6789:/ on /mnt/cephfs type
ceph (rw,relatime,name=admin,secret=<hidden>,fsid=31977b06-8cdb-42a9-97ad-
d6a7d59a42dd,acl,mds_namespace=cephfs)
192.168.1.195:6789,192.168.1.212:6789,192.168.1.213:6789:/ on /mnt/cephfs type
ceph (rw,relatime,name=admin,secret=<hidden>,fsid=31977b06-8cdb-42a9-97ad-
d6a7d59a42dd,acl,mds_namespace=cephfs)
192.168.1.195:6789,192.168.1.212:6789,192.168.1.213:6789:/ on /mnt/cephfs type
ceph (rw,relatime,name=admin,secret=<hidden>,fsid=31977b06-8cdb-42a9-97ad-
d6a7d59a42dd,acl,mds_namespace=cephfs)

And it looks really confusing to me. OK, let's imagine that mounting the same
file system instance into different folders (for example, /mnt/TestCephFS and
/mnt/cephfs) could make sense. However, I am not sure that it is correct
behavior. But mounting the same file system instance into the same folder
doesn't make sense to me. Maybe, I am missing something important here.

Am I correct here? Is it expected behavior? I assume that CephFS has incorrect
mount logic that creates the issue during umount operation? Any thoughts?

Thanks,
Slava.

[1] https://elixir.bootlin.com/linux/v6.17-rc1/source/fs/namespace.c#L2002

             reply	other threads:[~2025-08-25 21:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25 21:53 Viacheslav Dubeyko [this message]
2025-08-26  9:10 ` [RFC] ceph: strange mount/unmount behavior Christian Brauner
2025-08-26 18:58   ` Viacheslav Dubeyko

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=b803da9f0591b4f894f60906d7804a4181fd7455.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=Pavan.Rallabhandi@ibm.com \
    --cc=amarkuze@redhat.com \
    --cc=brauner@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=gfarnum@ibm.com \
    --cc=idryomov@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pdonnell@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).