From 2f746db408bf0aeeb3226d4b83e2a67e9c241b6d Mon Sep 17 00:00:00 2001 From: ericm Date: Tue, 16 Sep 2003 09:32:09 +0000 Subject: [PATCH] [liblustre]: fix inode->i_ref leak. if pnode revalidation failed we need remove the stale inode right away to prevent others access it again which cause i_ref leak. it's an libsysio limitation, not sure if it's the best way. --- lustre/liblustre/namei.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/liblustre/namei.c b/lustre/liblustre/namei.c index b265f7b..6eaf84cf 100644 --- a/lustre/liblustre/namei.c +++ b/lustre/liblustre/namei.c @@ -332,10 +332,11 @@ int llu_pb_revalidate(struct pnode *pnode, int flags, struct lookup_intent *it) if (req) ptlrpc_req_finished(req); if (rc == 0) { - if (pb->pb_ino && - S_ISDIR(llu_i2info(pb->pb_ino)->lli_st_mode)) + LASSERT(pb->pb_ino); + if (S_ISDIR(llu_i2info(pb->pb_ino)->lli_st_mode)) ll_invalidate_inode_pages(pb->pb_ino); llu_i2info(pb->pb_ino)->lli_stale_flag = 1; + unhook_stale_inode(pnode); } else { llu_lookup_finish_locks(it, pnode); llu_i2info(pb->pb_ino)->lli_stale_flag = 0; -- 1.8.3.1