Re: umount of unreachable NFS without -f [maybe PATCH]

Karel Zak
2014-09-03T07:49:19Z

On Tue, Sep 02, 2014 at 09:09:38PM +0200, Stanislav Brabec wrote:
> I just analyzed causes of hang while calling umount without -f on an
> unreachable NFS.
>
> The first hang happens on in lookup_umount_fs():
>
> stat(tgt, &st) == 0 && S_ISDIR(st.st_mode)
>
> I don't exactly know, what its removal causes, but I tried it.

The stat() is there to detect situations when someone calls

umount /dev/sda1

then you don't want to call statfs() to get fs type, because the
device is not a mountpoint. Note that statfs() works with arbitrary
file, so we have to be careful...

Karel

--
Karel Zak <kzak@redhat.com>