From: Carlos Maiolino <cmaiolino@redhat.com>
To: Yang Joseph <joseph.yang@xtaotech.com>
Cc: Dave Chinner <david@fromorbit.com>,
Eric Sandeen <sandeen@sandeen.net>,
sandeen@redhat.com, nathans@debian.org,
linux-xfs@vger.kernel.org
Subject: Re: xfs_repair: add '-F' option to ignore writable mount checking
Date: Mon, 26 Feb 2018 13:02:03 +0100 [thread overview]
Message-ID: <20180226120203.g4xt64nesqqmaffv@odin.usersys.redhat.com> (raw)
In-Reply-To: <5A9377FB.7000201@xtaotech.com>
On Mon, Feb 26, 2018 at 10:59:07AM +0800, Yang Joseph wrote:
> In our case, there is a mountpoint of ceph-fuse type and this mountpoint is
> abnormal.
> I execute 'xfs_repair -n /dev/nbd4' cmd. Then xfs_repair is blocked in
> stat()
> systemcall. '/dev/nbd4' has no relationship with the ceph-fuse mountpoint.
>
> [root@compute5 ~]# ps aux | grep xfs_repair
> root 16469 0.0 0.0 114744 564 ? D 10:50 0:00 xfs_repair
> -n /dev/nbd4
>
> [root@compute5 ~]# cat /proc/16469/stack
> [<ffffffffa04b953d>] __fuse_request_send+0x13d/0x2c0 [fuse]
> [<ffffffffa04b96d2>] fuse_request_send+0x12/0x20 [fuse]
> [<ffffffffa04be67a>] fuse_do_getattr+0x11a/0x2e0 [fuse]
> [<ffffffffa04bfba5>] fuse_update_attributes+0x75/0x80 [fuse]
> [<ffffffffa04bfbf3>] fuse_getattr+0x43/0x50 [fuse]
> [<ffffffff81203976>] vfs_getattr+0x46/0x80
> [<ffffffff81203aa5>] vfs_fstatat+0x75/0xc0
> [<ffffffff81203ffe>] SYSC_newstat+0x2e/0x60
> [<ffffffff812042de>] SyS_newstat+0xe/0x10
> [<ffffffff81697809>] system_call_fastpath+0x16/0x1b
> [<ffffffffffffffff>] 0xffffffffffffffff
>
So, you have a mount point stuck because fuse can't connect. Why should
xfs_repair workaround this issue?
> The stat() is from the following code:
>
> // libxfs/linux.c:platform_check_mount()
> while ((mnt = getmntent(f)) != NULL) {
> if (stat64(mnt->mnt_fsname, &mst) < 0) <---------<<<< unconditionally
> stat all mountpoints
> continue;
>
> xfs_repair have to check all mountpoints of the system to make sure there is
> no writable mount point of user specified device. If there is one abnormal
> mountpoint, event it not related to user specified device, xfs_repair will
> be blocked.
>
> I can make sure there is no writable mountpoint of /dev/nbd4, so xfs_repair
> don't need to check all mountpoints of the system. This is why I want to add
> this '-F' option.
>
While I understand your point, I wonder why you can't close the specific fuse
connection here, and, if the right approach for you wouldn't be able to close
this fuse connection, instead of hack xfs_repair to bypass mount point checks.
In any way, I think '-F' is really not a good argument for such force, it could
easily be used by mistake in place of, let's say '-f', if such option is ever to
be implemented, it should be typo-safe, something like --force.
But still, I think the right approach here would be fuse to provide a way to
force a close on the specific connection.
> Because there are lots of other services on this node, I can't reboot the
> machine.
>
> thx
>
> Yang Honggang
>
> > > > hello,
> > > >
> > > > Before the repair process, xfs_repair will check if user specified device already
> > > > has a writable mountpoint. And it will stat all the mountpoints of the system. If there
> > > > is a dead mountpoint, this checking will be blocked and xfs_repair will enter 'D' state.
> > So why is the mount point dead?
> >
> > That kinda means that the filesystem is still mounted, but something
> > has hung somewhere and the filesystem may still have active
> > references to the underlying device and be doing stuff that is
> > modifying the filesystem....
> >
> > And if the device is still busy, then you aren't going to be able to
> > mount the repaired device, anyway, because the block device is still
> > busy...
> >
> > > That sounds like a bug worth fixing, but I am much
> > > less excited about adding options which could do serious damage
> > > to a filesystem.
> > TO me it sounds like something that should be fixed by a reboot, not
> > by adding dangerous options to xfs_repair...
> >
> > Cheers,
> >
> > Dave.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Carlos
next prev parent reply other threads:[~2018-02-26 12:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-24 11:23 xfs_repair: add '-F' option to ignore writable mount checking Yang Joseph
2018-02-24 17:56 ` Eric Sandeen
2018-02-24 22:04 ` Dave Chinner
2018-02-24 22:08 ` Eric Sandeen
2018-02-26 2:59 ` Yang Joseph
2018-02-26 12:02 ` Carlos Maiolino [this message]
2018-02-26 12:19 ` Brian Foster
2018-02-27 10:44 ` Yang Joseph
2018-02-27 10:57 ` Carlos Maiolino
2018-02-27 14:47 ` Eric Sandeen
2018-02-28 3:31 ` Yang Joseph
2018-02-28 3:34 ` Yang Joseph
[not found] <5A97638A.9050509@xtaotech.com>
2018-03-01 2:31 ` Yang Joseph
2018-03-02 6:23 ` Yang Joseph
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=20180226120203.g4xt64nesqqmaffv@odin.usersys.redhat.com \
--to=cmaiolino@redhat.com \
--cc=david@fromorbit.com \
--cc=joseph.yang@xtaotech.com \
--cc=linux-xfs@vger.kernel.org \
--cc=nathans@debian.org \
--cc=sandeen@redhat.com \
--cc=sandeen@sandeen.net \
/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).