Unionfs ODF: Fix a lockdep warning on nfsd_readdir of exported unionfs mount
authorRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Sun, 18 May 2008 07:37:20 +0000 (03:37 -0400)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Sun, 18 May 2008 07:37:20 +0000 (03:37 -0400)
commite65b147a9e1d496bf1b4266e796f567f36ba4ab4
tree8fb95ef89b34489be0e333b6800b45ca1dfbacbb
parent72e802dbbaa10242f318faa5ce04ad7d3bb48716
Unionfs ODF: Fix a lockdep warning on nfsd_readdir of exported unionfs mount

nfsd_readdir calls vfs_llseek and vfs_readdir. Following is the locking
order seen by lockdep:
vfs_llseek: sb -> dentry -> inode
vfs_readdir: inode -> sb -> dentry
Lockdep reports this as a possible circular locking order bug.

To fix this, we define our own unionfs_file_llseek_locked function,
which is essentially the vfs generic_file_llseek function, but with
the inode locking moved into the caller. This now changes the locking
order in vfs_llseek call to be: inode -> sb -> dentry, and satisfies
lockdep too.

Signed-off-by: Rachita Kothiyal <rachita@fsl.cs.sunysb.edu>
fs/unionfs/dirfops.c