From: Martin Papik <mp6058@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Linux fs XFS <xfs@oss.sgi.com>
Subject: Re: XFS filesystem claims to be mounted after a disconnect
Date: Thu, 05 Jun 2014 04:07:33 +0300 [thread overview]
Message-ID: <538FC2D5.3080402@gmail.com> (raw)
In-Reply-To: <20140605000803.GA4523@dastard>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
>> 1) I would LOVE to unmount the FS, but how? umount /dev/xxx ...
>> device no longer there. umount /media/xxx ... mount point no
>> longer there.
>
> Oh, something is doing a lazy unmount automatically on device
> unplug? I missed the implications of that - your system is
> behaviour exactly as it has been told to behave.
>
> That is, lazy unmount only detaches the mount namespace from the
> mount - it doesn't actually tell the kernel to unmount the
> filesystem internally, instead it just removes the reference count
> it has on it. If there are other open references to the
> filesystem, then it won't actually do the real unmount until those
> references go away. i.e. lazy unmount is designed to leave the
> kernel superblock (i.e. the filesystem) mounted internally until
> the last reference to it goes away.
>
> And that leaves the user to find those references and clean them up
> so the kernel can actually unmount it. Put simply, the system is
> behaving exactly as it has been asked to act in response to your
> actions. Whether the automounter is behaving correctly or not, that
> is a different matter, but it is certainly not an XFS bug that a
> lazy unmount is leaving you with a mess that you need to cleanup
> manually.
But XFS is the one that prevents the repair. For reasons you've
outlined, granted, but it's XFS no longer has access to the device, so
it shouldn't be blocking it.
>> 2) I can't rectify the problems exactly because the FS is mounted
>> (according to xfs_repair [ustat]), yet not mounted (according to
>> /proc/mounts). .... unless rectifying the problem means reporting
>> this as a bug. :-)
>
> Not a bug, it's the desired behaviour of lazy unmounts. Fix
> userspace not to hold references when unmounting the filesystem...
Yet it doesn't affect ext4 (to pick an example at random). And the
only way to fix the userspace in this case is to start killing
processes, and again, this is only required for XFS.
>> 3) "Shutting down filesystem" ... isn't this when the new device
>> should no longer be detected as mounted?
>
> No. Filesystems get shut down for all sorts of reasons and the
> correct action to take after unmounting the filesystem depends on
> the reason for the shutdown. i.e. a shutdown filesystem requires
> manual intervention to recover from, and so the filesystem remains
> mounted until such manual intervention can take place.
Once more, shouldn't XFS stop holding onto the UUID after the FS is
shut down AND the underlying device (all of them, in case of
multipath) is returning an error code which means the device won't
ever come back? Seriously, the device is gone, won't come back.
Wouldn't it make sense to just let xfs_repair do its job?
And one more question, did you see the lsof output in my previous
email? Did you notice that while both XFS ans ext4 are still there,
the file that's still in use on ext4 shows the device number, but not
XFS. Just to refresh, here's a copy.
$ lsof | grep TEST
hexedit 24010 martin 3u unknown /TEST...FILE (stat:
Input/output error)
hexedit 24011 martin 3u REG 259,6 4198400
12 /TEST...FILE
See, ext4 was device 259:6, but on XFS the device number doesn't show up.
Looks like lsof is doing a stat (not an lstat) on /proc/X/fd/Y, and
ext4 returns the full inode info, but XFS doesn't. Is this OK? This
info would be the only way to positively tie the processes to the
specific filesystem, wouldn't it?
# stat -L /proc/{15478,15496}/fd/3
stat: cannot stat `/proc/15478/fd/3': Input/output error
File: `/proc/15496/fd/3'
Size: 4198400 Blocks: 520 IO Block: 4096 regular file
Device: 10306h/66310d Inode: 12 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ martin) Gid: ( 1000/ martin)
Access: 2014-06-05 03:46:42.969617017 +0300
Modify: 2014-03-11 16:24:22.500349375 +0300
Change: 2014-03-11 16:24:22.500349375 +0300
Birth: -
# strace -e trace=stat stat -L /proc/{15478,15496}/fd/3
stat("/proc/15478/fd/3", 0x7fffcfad7580) = -1 EIO (Input/output error)
stat: cannot stat `/proc/15478/fd/3': Input/output error
stat("/proc/15496/fd/3", {st_mode=S_IFREG|0644, st_size=4198400, ...}) = 0
File: `/proc/15496/fd/3'
Size: 4198400 Blocks: 520 IO Block: 4096 regular file
Device: 10306h/66310d Inode: 12 Links: 1
stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7fffcfad69a0) = -1 ENOENT
(No such file or directory)
stat("/lib/x86_64-linux-gnu/tls", 0x7fffcfad69a0) = -1 ENOENT (No such
file or directory)
stat("/lib/x86_64-linux-gnu/x86_64", 0x7fffcfad69a0) = -1 ENOENT (No
such file or directory)
stat("/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=12288,
...}) = 0
stat("/usr/lib/x86_64-linux-gnu/tls/x86_64", 0x7fffcfad69a0) = -1
ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls", 0x7fffcfad69a0) = -1 ENOENT (No
such file or directory)
stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7fffcfad69a0) = -1 ENOENT
(No such file or directory)
stat("/usr/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755,
st_size=69632, ...}) = 0
stat("/lib/tls/x86_64", 0x7fffcfad69a0) = -1 ENOENT (No such file or
directory)
stat("/lib/tls", 0x7fffcfad69a0) = -1 ENOENT (No such file or
directory)
stat("/lib/x86_64", 0x7fffcfad69a0) = -1 ENOENT (No such file or
directory)
stat("/lib", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
stat("/usr/lib/tls/x86_64", 0x7fffcfad69a0) = -1 ENOENT (No such file
or directory)
stat("/usr/lib/tls", 0x7fffcfad69a0) = -1 ENOENT (No such file or
directory)
stat("/usr/lib/x86_64", 0x7fffcfad69a0) = -1 ENOENT (No such file or
directory)
stat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=90112, ...}) = 0
Access: (0644/-rw-r--r--) Uid: ( 1000/ martin) Gid: ( 1000/ martin)
Access: 2014-06-05 03:46:42.969617017 +0300
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=195, ...}) = 0
Modify: 2014-03-11 16:24:22.500349375 +0300
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=195, ...}) = 0
Change: 2014-03-11 16:24:22.500349375 +0300
Birth: -
>> 4) come to think of it, if XFS is shutting down, why isn't it
>> unmounting itself?
>
> Because a filesystem cannot unmount itself - that has to be done
> from userspace.
That makes sense.
Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCgAGBQJTj8LPAAoJELsEaSRwbVYrQ7IP/1rLx09jgQBK+4tlcSZqjd8G
dOYQ4onEUrUPUh9/wfzmfArK0DqKSrNK2Gp9y2IpuHIW7i/700TziL1ryVh9k6F+
4Yf+7xPz/tzKQONe/X3XpdO9jSoyJ3pfIQh5Zq7fgUMl6dSr+S3hFYGJ/ZoDgwz5
/E9z17J8Avur3PJNto1CZA5/KqpiRcm/EwXclQMkvN6I7VfJWLiTtmpzntAbzYJI
2QaUP3/k9IxIEB3sydZcGCvcMxljglCrGhFnUX/Q0/qtVMZpHH/oyGZw1KifxUFf
/R5lw1h5CBSHY6fMsjZXWXFvIfzSnli5hV9jIjjRi/tVdXLDCnz4JV3DUP3lMjLc
K8srNBQwk/FM7jOnNcmoAS/EIAx3+FAC8JZL47GbA8EWgDjzUk/AhVAfpvwXkIig
5MA0qn2aYMnLNaUeE8/ZYN5c/5ZnJUnruaL4vM/oP+7YNHnr04GQXoFmIoJ7KOL+
0bhtozACj7K2pNlBS+0jvSY7HnampTdcNXREqHk+hkKzn69vI4xcPNrYRCCyY0hz
OISdfUAMlUighsxy999EYLVz6bLiSy4IJ3aen09SHvRS1iifJycV3MLpiOJl3GED
84AEGLCGCBNHAqP7oWn5acXNSzkvuNTJ1dTpSmL3V+mg9GeoduNyhwP8ymEdsyOE
BH075Xvzf5qh3qLTCELi
=84Mu
-----END PGP SIGNATURE-----
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2014-06-05 1:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-02 13:47 XFS filesystem claims to be mounted after a disconnect Martin Papik
2014-05-02 15:04 ` Eric Sandeen
2014-05-02 15:07 ` Eric Sandeen
2014-05-02 15:44 ` Mark Tinguely
2014-05-02 16:26 ` Martin Papik
2014-05-02 16:44 ` Martin Papik
2014-05-02 16:53 ` Eric Sandeen
2014-05-02 17:54 ` Martin Papik
2014-05-02 18:39 ` Eric Sandeen
2014-05-02 19:07 ` Martin Papik
2014-05-02 19:16 ` Eric Sandeen
2014-05-02 19:29 ` Martin Papik
2014-05-02 23:38 ` Dave Chinner
2014-05-02 23:35 ` Dave Chinner
2014-05-03 0:04 ` Martin Papik
2014-05-03 3:02 ` Dave Chinner
2014-06-02 11:22 ` Martin Papik
2014-06-02 23:41 ` Dave Chinner
2014-06-03 9:23 ` Martin Papik
2014-06-03 9:55 ` Stefan Ring
2014-06-03 10:48 ` Martin Papik
2014-06-03 21:28 ` Dave Chinner
2014-06-03 22:37 ` Martin Papik
2014-06-05 0:55 ` Dave Chinner
2014-06-05 1:38 ` Martin Papik
2014-06-05 19:39 ` Martin Papik
2014-06-05 22:41 ` Dave Chinner
2014-06-06 0:47 ` Martin Papik
2014-06-03 22:58 ` Martin Papik
2014-06-05 0:08 ` Dave Chinner
2014-06-05 1:07 ` Martin Papik [this message]
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=538FC2D5.3080402@gmail.com \
--to=mp6058@gmail.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).