[Yaffs] Yaffs on MTD, strange umount behaviour

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Brad Beveridge
Date:  
To: yaffs
Subject: [Yaffs] Yaffs on MTD, strange umount behaviour
Hi yaffsers. I've noticed some slight strangeness in the yaffs/mtd
interaction.
I have put debugging code in the
drivers/mtd/mtd_blkdevs::blktrans_open/release functions, and when yaffs
mounts blktrans_open gets called, and the use count increases. When
yaffs is umounted the blktrans_release function is not called -
therefore the use count isn't decremented, and other clean up operations
aren't done. Normally this is OK, I can mount & umount as many times as
I like. However, if I happen to remove my mtd device (if you are
curious, I have removable nand storage & I am rmmoding the nand driver
module), then add the mtd device back & remount yaffs, it borks.

In the below structure (yaffs_fs.c)
static struct file_system_type yaffs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "yaffs",
        .get_sb         = yaffs_read_super,
        //.kill_sb        = kill_block_super,
        .kill_sb      = kill_litter_super,
        .fs_flags       = FS_REQUIRES_DEV,
};
.kill_sb is set to kill_litter_super, but there is a (commented out) 
alternative of .kill_sb = kill_block_super.
I have found that setting kill_sb to be kill_block_super causes the 
blktrans_release function to be called when yaffs is unmounted, and I 
can happily go through the sequence of
- insmod driver
- mount yaffs
- umount yaffs
- rmmod driver


My question is: why should the default kill_litter_super be prefered
over kill_block_super, and what might I have screwed up in the process
of changing from one function to another?

Cheers
Brad