query on VFS busy inode

Rishi Agrawal rishi.b.agrawal at gmail.com
Wed Feb 26 05:30:18 EST 2014


On Wed, Feb 26, 2014 at 11:16 AM, Rohan Puri <rohan.puri15 at gmail.com> wrote:

> On Wed, Feb 26, 2014 at 1:08 AM, Abhishek Dave <cfsxdave at gmail.com> wrote:
> > Hello All,
> >
> > Can some one please help me to understand meaning of below code
> >
> > <snip>
> >
> >         if (!list_empty(&sb->s_inodes)) {
> > 406                         printk("VFS: Busy inodes after unmount of
> %s. "
> > 407                            "Self-destruct in 5 seconds.  Have a nice
> > day...\n",
> > 408                            sb->s_id);
> > 409                 }
> >
> > </snip>
> >
> > Are we doing here?
> >
> > Thanks,
> >
> > Dave
> >
> >
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
> Hi Abhishek,
>
> This code gets called during unmounting of a filesystem. During
> unmounting, if there are busy inodes present in the list contained in
> superblock (s_inodes field), just log the error through the printk &
> go forward through the unmounting process.
>
> - Regards,
>      Rohan
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


Well, this code is called when unmounting the file system.

When a file system is registered it will register two important functions

1. the .mount and the
2 .kill_super function. See the struct file_system_type.

File systems generally register the kill_block_super() function to the
kill_super pointer.

When kill_block_super() is called it will call generic_shutdown_super()
whose task is to

1. remove the dentries related to the file system from the hash and other
lists
2. sync the file system (dirty buffers, inodes and data)
3. evict the inodes from the cache. -- see function evict_inodes()
    This function goes into the super block's list of inodes and collects
the inodes which need to be removed from the cache and calls the
dispose_list() function

4. The dispose list is the workhorse which will iterate through each inode
in the list and call the registered .evict_inode function and destroy_inode
function registered in the super_block.

After all this is the sb->s_inodes list has elements/inodes then there is
something wrong.

It just pukes error and completes the umount operation. Generally the code
will not get into this if you have not implemented your own
".destroy_inode" or ".evict_inode" function.

HTH




-- 
Regards,
Rishi Agrawal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140226/af6891ce/attachment.html 


More information about the Kernelnewbies mailing list