Re: mnt_count accounting broken

From: Tigran Aivazian (tigran@veritas.com)
Date: Fri May 05 2000 - 14:39:42 EST


On Fri, 5 May 2000, Alexander Viro wrote:
> On Fri, 5 May 2000, Tigran Aivazian wrote:
>
> > On Fri, 5 May 2000, Alexander Viro wrote:
> > > Solution:
> > > ramfs_umount_begin() that would do equivalent of rm -rf.
> > > With the changes I'm doing right now we will catch busy filesystems
> > > without dentry scan, thus we are safe here.
> >
> > but umount_begin() is invoked only with MNT_FORCE. Are you suggesting that
> > ramfs filesystems should be umountable only by 'umount -f'?
>
> Ouch. Yes, you are right. Oh, shit... We certainly can decide that for
> some fs types umount_begin is called always, but that quickly becomes
> rather ugly. Linus, your opinion? The problem is obvious - you hold extra
> references to dentries, so umounting the nonempty fs is kinda tricky. OTOH
> here we really want all inodes to be destroyed... Comments?
>

Dear People, I am sorry but did you read my log at all? Both Linus and Al
claim that the problem is umounting the nonempty fs but I think I
illustrated clearly that even when ramfs filesystem is empty - it cannot
be umounted. Here is the extract:

# mount -t ramfs none /mnt/m5
# touch /mnt/m5/new
# umount /mnt/m5
C: count!=2 (3)
umount: /mnt/m5: device is busy
# rm /mnt/m5/new
# umount /mnt/m5
A: mnt_count>2 (3)
umount: /mnt/m5: device is busy
# l /mnt/m5
total 0
# umount /mnt/m5
A: mnt_count>2 (3)
umount: /mnt/m5: device is busy

can you see in the last two attempts that filesystem was empty and yet it
refuses to be umounted because mnt_count>2 (3)?

Thanks,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:18 EST