public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* d_splice_alias() problem.
@ 2004-04-23 13:02 Nikita Danilov
  2004-04-23 15:40 ` Andreas Dilger
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Nikita Danilov @ 2004-04-23 13:02 UTC (permalink / raw)
  To: linux kernel mailing list, alexander viro, trond myklebust,
	neil brown

Hello,

for some time I am observing that during stress tests over NFS

   shrink_slab->...->prune_dcache()->prune_one_dentry()->...->iput()

is called on inode with ->i_nlink == 0 which results in truncate and
file deletion. This is wrong in general (file system is re-entered), and
deadlock prone on some file systems.

After some debugging, I tracked problem down the to d_splice_alias()
failing to identify dentries when necessary.

Suppose we have an inode with ->i_nlink == 1. It's accessed over NFS and
DCACHE_DISCONNECTED dentry D1 is created for it. Then, unlink request
comes for this file. nfsd looks name up in the parent directory
(nfsd_unlink()->lookup_one_len()). File system back-end uses
d_splice_alias(), but it only works for directories and we end up with
second (this time connected) dentry D2.

D2 is successfully unlinked, file has ->i_nlink == 0, and ->i_count == 1
from D1, and when prune_dcache() hits D1 bad things happen.

It's hard to imagine how new name can be identified with one among
multiple anonymous dentries, which is necessary for
NFSEXP_NOSUBTREECHECK export to work reliably.

One possible work-around is to forcibly destroy all remaining
DCACHE_DISCONNECTED dentries when ->i_nlink drops to zero, but I am not
sure that this is possible and solves all problems of having more
dentries than there are nlinks.

Nikita.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2004-05-13  7:18 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-23 13:02 d_splice_alias() problem Nikita Danilov
2004-04-23 15:40 ` Andreas Dilger
2004-04-23 16:20   ` Nikita Danilov
2004-04-23 23:49 ` Andrew Morton
2004-04-26 12:45   ` Nikita Danilov
2004-04-30  4:54 ` Neil Brown
2004-04-30  7:50   ` Greg Banks
2004-04-30 13:28   ` Nikita Danilov
2004-05-03 23:46     ` Neil Brown
2004-05-03 12:02   ` Greg Banks
2004-05-03 23:28     ` Neil Brown
2004-05-04  0:05       ` Greg Banks
2004-05-04  7:00       ` Greg Banks
2004-05-04  9:46         ` viro
2004-05-04 10:21           ` Greg Banks
2004-05-05  0:11           ` Neil Brown
2004-05-10  3:03         ` Neil Brown
2004-05-10  4:50           ` Greg Banks
2004-05-10  3:27       ` Neil Brown
2004-05-10 11:28         ` Greg Banks
2004-05-13  5:58           ` Neil Brown
2004-05-13  7:15             ` Greg Banks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox