<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 11:16 AM, Rohan Puri <span dir="ltr"><<a href="mailto:rohan.puri15@gmail.com" target="_blank">rohan.puri15@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Feb 26, 2014 at 1:08 AM, Abhishek Dave <<a href="mailto:cfsxdave@gmail.com">cfsxdave@gmail.com</a>> wrote:<br>
> Hello All,<br>
><br>
> Can some one please help me to understand meaning of below code<br>
><br>
> <snip><br>
><br>
> if (!list_empty(&sb->s_inodes)) {<br>
> 406 printk("VFS: Busy inodes after unmount of %s. "<br>
> 407 "Self-destruct in 5 seconds. Have a nice<br>
> day...\n",<br>
> 408 sb->s_id);<br>
> 409 }<br>
><br>
> </snip><br>
><br>
> Are we doing here?<br>
><br>
> Thanks,<br>
><br>
> Dave<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
<br>
Hi Abhishek,<br>
<br>
This code gets called during unmounting of a filesystem. During<br>
unmounting, if there are busy inodes present in the list contained in<br>
superblock (s_inodes field), just log the error through the printk &<br>
go forward through the unmounting process.<br>
<br>
- Regards,<br>
Rohan<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br><br clear="all"></div><div class="gmail_extra">Well, this code is called when unmounting the file system.<br><br></div><div class="gmail_extra">When a file system is registered it will register two important functions <br>
<br>1. the .mount and the<br>2 .kill_super function. See the struct file_system_type.<br><br></div><div class="gmail_extra">File systems generally register the kill_block_super() function to the kill_super pointer.<br><br>
</div><div class="gmail_extra">When kill_block_super() is called it will call generic_shutdown_super() whose task is to <br><br></div><div class="gmail_extra">1. remove the dentries related to the file system from the hash and other lists<br>
</div><div class="gmail_extra">2. sync the file system (dirty buffers, inodes and data)<br></div><div class="gmail_extra">3. evict the inodes from the cache. -- see function evict_inodes()<br></div><div class="gmail_extra">
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<br><br></div><div class="gmail_extra">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.<br>
<br></div><div class="gmail_extra">After all this is the sb->s_inodes list has elements/inodes then there is something wrong.<br><br></div><div class="gmail_extra">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.<br>
<br></div><div class="gmail_extra">HTH<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"> <br></div><div class="gmail_extra"><br><br>-- <br>Regards,<br>Rishi Agrawal<br>
</div></div>