From 81853ea5268560f63fda996532353237f73ef6d2 Mon Sep 17 00:00:00 2001 From: alex <alex> Date: Fri, 16 Sep 2005 01:05:26 +0000 Subject: [PATCH] - check for bad inode in smfs_do_lookup() --- lustre/smfs/dir.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lustre/smfs/dir.c b/lustre/smfs/dir.c index bea797efee..469f77c324 100644 --- a/lustre/smfs/dir.c +++ b/lustre/smfs/dir.c @@ -227,19 +227,22 @@ static int smfs_do_lookup (struct inode * dir, I2SMI(dir), 0); if (!(*inode)) rc = -ENOENT; - else { - if (!tmp->d_inode->i_nlink) { - struct inode * ind = tmp->d_inode; - - CWARN("inode #%lu (%*s) nlink is %i/%i\n", - ind->i_ino, tmp->d_name.len, - tmp->d_name.name, ind->i_nlink, - (*inode)->i_nlink); - CWARN("parent #%lu (%*s) nlink is %i\n", - dir->i_ino, tmp->d_parent->d_name.len, - tmp->d_parent->d_name.name, - cache_dir->i_nlink); - } + else if (!tmp->d_inode->i_nlink) { + struct inode * ind = tmp->d_inode; + + CDEBUG(D_ERROR, "inode #%lu (%*s) nlink is %i/%i\n", + ind->i_ino, tmp->d_name.len, + tmp->d_name.name, ind->i_nlink, + (*inode)->i_nlink); + CDEBUG(D_ERROR, "parent #%lu (%*s) nlink is %i\n", + dir->i_ino, tmp->d_parent->d_name.len, + tmp->d_parent->d_name.name, + cache_dir->i_nlink); + CDEBUG(D_ERROR, "rc = %d\n", rc); + + if (is_bad_inode(ind)) + CDEBUG(D_ERROR, "bad inode returned %lu/%u\n", + ind->i_ino, ind->i_generation); } } } -- GitLab