Skip to contentSkip to conversation

umount -a -f -t nfs doesn't work when a file has been written and "-l" option is needed

DISCUSSION Pacho Ramos 3 participants 5 messages Sep 5, 2009 – Sep 12, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I suffer the following problem with nfs since a lot of time, now, I am using nfs-utils-1.2.0, but older versions were affected too.

When I write a file on a mounted nfs filesystem and server goes down, I am unable to umount it even with "-f" option, it simply hangs. On the other hand, if no file was written (for example, it was simply read) there is no problem and "umount -f" works as expected.

Seems that I need to run "umount -l" for being able to unmount it, even when I expected that "-f" should be enough.

Is this the proper behavior or something is going wrong?

Thanks a lot :-)

#1 lore raw
Quoted 7 lines · Pacho Ramos

I suffer the following problem with nfs since a lot of time, now, I am using nfs-utils-1.2.0, but older versions were affected too.

When I write a file on a mounted nfs filesystem and server goes down, I am unable to umount it even with "-f" option, it simply hangs. On the other hand, if no file was written (for example, it was simply read) there is no problem and "umount -f" works as expected.

I believe 'umount -f' waits for all the async or sync (I can't remember) RPC tasks to complete before returning... That's the reason for the hang.

Quoted 3 lines

Seems that I need to run "umount -l" for being able to unmount it, even when I expected that "-f" should be enough.

Hopefully you will be rebooting soon since kernel structures (ala the super block) are not cleaned up with 'umount -l'. Which could make the system somewhat unstable.

Quoted 2 lines

Is this the proper behavior or something is going wrong?

Its the known behaviour... whether its correct or not is up to interpretation... ;-) Meaning, 'umount -f' probably should not hang waiting for I/O to finish, but error-ing on the "lets do everything we can not to corrupt data" is not a bad stand either...

steved.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

El mar, 08-09-2009 a las 09:40 -0400, Steve Dickson escribi=C3=B3:

Quoted 2 lines · Pacho Ramos
Quoted 1 line

I suffer the following problem with nfs since a lot of time, now, I=

am

Quoted 3 lines
Quoted 3 lines

using nfs-utils-1.2.0, but older versions were affected too. =20
When I write a file on a mounted nfs filesystem and server goes dow=

n, I

Quoted 1 line
Quoted 1 line

am unable to umount it even with "-f" option, it simply hangs. On t=

he

Quoted 1 line
Quoted 1 line

other hand, if no file was written (for example, it was simply read=

)

Quoted 2 lines
Quoted 1 line

there is no problem and "umount -f" works as expected.

I believe 'umount -f' waits for all the async or sync (I can't rememb=

er)

Quoted 1 line

RPC tasks to complete before returning... That's the reason for the h=

ang.

Quoted 3 lines

=20

Quoted 2 lines

=20
Seems that I need to run "umount -l" for being able to unmount it, =

even

Quoted 3 lines
Quoted 1 line

when I expected that "-f" should be enough.

Hopefully you will be rebooting soon since kernel structures (ala the super block) are not cleaned up with 'umount -l'. Which could make th=

e

Quoted 8 lines

system somewhat unstable.=20
=20

Quoted 2 lines

=20
Is this the proper behavior or something is going wrong?

Its the known behaviour... whether its correct or not is up to interpretation... ;-) Meaning, 'umount -f' probably should not hang waiting for I/O to finish, but error-ing on the "lets=20 do everything we can not to corrupt data" is not a bad stand either..=

=2E

Quoted 3 lines

=20
steved.
=20

Thanks a lot for the info :-)

#4 lore raw
In reply to a message not in the archive
Quoted 12 lines · Steve Dickson
Quoted 7 lines · Pacho Ramos

I suffer the following problem with nfs since a lot of time, now, I am using nfs-utils-1.2.0, but older versions were affected too.

When I write a file on a mounted nfs filesystem and server goes down, I am unable to umount it even with "-f" option, it simply hangs. On the other hand, if no file was written (for example, it was simply read) there is no problem and "umount -f" works as expected.

I believe 'umount -f' waits for all the async or sync (I can't remember) RPC tasks to complete before returning... That's the reason for the hang.

Quoted 1 line
Quoted 5 lines
Quoted 2 lines

Seems that I need to run "umount -l" for being able to unmount it, even when I expected that "-f" should be enough.

Hopefully you will be rebooting soon since kernel structures (ala the super block) are not cleaned up with 'umount -l'. Which could make the system somewhat unstable.

Um... Not really. The damn thing is detached from the namespace and left alone until it's not busy anymore. At that point it's hit with the rest of umount() (i.e. with filesystem driver being told to shut it down).

So it won't go away in that case, but you shouldn't get any instability from that - from the VFS POV nothing nasty has happened, from the NFS client code POV... well, it's not being unmounted yet, as far as NFS code cares. Just a mounted fs from a stuck server...

#5 lore raw

El s=C3=A1b, 12-09-2009 a las 16:01 +0100, Al Viro escribi=C3=B3:

Quoted 1 line
Quoted 1 line
Quoted 1 line

Seems that I need to run "umount -l" for being able to unmount it=

, even

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

when I expected that "-f" should be enough.

Hopefully you will be rebooting soon since kernel structures (ala t=

he

Quoted 1 line
Quoted 1 line

super block) are not cleaned up with 'umount -l'. Which could make =

the

Quoted 4 lines
Quoted 1 line

system somewhat unstable.=20

=20
Um... Not really. The damn thing is detached from the namespace and left alone until it's not busy anymore. At that point it's hit with =

the

Quoted 1 line

rest of umount() (i.e. with filesystem driver being told to shut it d=

own).

Quoted 2 lines

=20
So it won't go away in that case, but you shouldn't get any instabili=

ty from

Quoted 1 line

that - from the VFS POV nothing nasty has happened, from the NFS clie=

nt

Quoted 1 line

code POV... well, it's not being unmounted yet, as far as NFS code ca=

res.

Quoted 1 line

Just a mounted fs from a stuck server...

OK :-)

Anyway, I am running this just before halting system , to prevent suffering the hang when powering off my computer ;-)

Thanks!