lock_kernel twice possible ?

From: li nux
Date: Sat Oct 15 2005 - 02:05:14 EST


I was going thru the NFS v3 code for SMP kernel 2.6.11
to see how an inode gets revalidated. I found that
there is a possibility that there may be an attempt to
do lock_kernel() twice.

Is this possible ? If yes then how this deadlock
condition is/can be avoided.


Below is the code flow (please see ** for

- __nfs_revalidate_inode
- ** lock_kernel() **
- nfs_wait_on_inode
- Call getattr() (which is nfs3_proc_getattr()) to
get the attributes from the server and
refresh the inode with the new values
- IF the cached data is invalid for the inode
- Writeback (If dirty) and sync the
inode, call nfs_wb_all
- nfs_wb_all
- nfs_sync_inode
- call nfs_wait_on_requests to wait for
the requests associated with the pages
to get complete
- nfs_flush_inode
- nfs_scan_dirty
- nfs_flush_list
- nfs_flush_one
- nfs_write_rpcsetup
- nfs3_proc_write_setup
- rpc_init_task
- rpc_call_setup
- nfs_execute_write
- ** lock_kernel() **
- rpc_execute
- ** unlock_kernel() **
- ** unlock_kernel() **

Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/