Whamcloud - gitweb
[liblustre]: fix inode->i_ref leak. if pnode revalidation failed we need
authorericm <ericm>
Tue, 16 Sep 2003 09:32:09 +0000 (09:32 +0000)
committerericm <ericm>
Tue, 16 Sep 2003 09:32:09 +0000 (09:32 +0000)
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

index b265f7b..6eaf84c 100644 (file)
@@ -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;