Skip to contentSkip to conversation

Solve the problem that umount will fail when an opened file isn't closed

DISCUSSION colin 2 participants 3 messages Jun 16, 2006 – Jun 19, 2006

lore
Share & tools
lore

colin

author
#0 lore raw

Hi all,
I have implemented an auto-mount & auto-umount facility based on USB hotplug.
An annoying problem will occur when some process doesn't close its open file and auto-umount is trying to umount that mount point after usb disk has been unplugged.
Is there any way to force it to be umounted in this situation?

Regards,
Colin

#1 lore raw
Quoted 9 lines

Hi all,
I have implemented an auto-mount & auto-umount facility based on USB hotplug.
An annoying problem will occur when some process doesn't close its open file and auto-umount is trying to umount that mount point after usb disk has been unplugged.
Is there any way to force it to be umounted in this situation?

fs/super.c:

    /* Forget any remaining inodes */
    if (invalidate_inodes(sb)) {
        printk("VFS: Busy inodes after unmount of %s. "
           "Self-destruct in 5 seconds.  Have a nice day...\n",
           sb->s_id);
    }

That's what happens if you eject a CD. The box won't explode though.

Jan Engelhardt

author
#2 lore raw

Hi Jan,
I found that if the process doesn't close the file after usb disk is unplugged, generic_shutdown_super won't be invoked. generic_shutdown_super will be invoked right after all opened files are closed.

Regards,
Colin

----- Original Message -----
From: "Jan Engelhardt" <[email protected]>
To: "colin" <[email protected]>
Cc: <[email protected]>
Sent: Friday, June 16, 2006 11:34 PM
Subject: Re: Solve the problem that umount will fail when an opened file isn't closed

Quoted 5 lines
Quoted 5 lines

Hi all,
I have implemented an auto-mount & auto-umount facility based on USB hotplug.
An annoying problem will occur when some process doesn't close its open

file

Quoted 1 line
Quoted 1 line

and auto-umount is trying to umount that mount point after usb disk has

been

Quoted 18 lines
Quoted 3 lines

unplugged.
Is there any way to force it to be umounted in this situation?

fs/super.c:

    /* Forget any remaining inodes */
    if (invalidate_inodes(sb)) {
        printk("VFS: Busy inodes after unmount of %s. "
           "Self-destruct in 5 seconds.  Have a nice day...\n",
           sb->s_id);
    }

That's what happens if you eject a CD. The box won't explode though.

Jan Engelhardt
--