Whamcloud - gitweb
b=17807
authorvs <vs>
Wed, 29 Jul 2009 00:39:45 +0000 (00:39 +0000)
committervs <vs>
Wed, 29 Jul 2009 00:39:45 +0000 (00:39 +0000)
i=h.huang,nikita.danilov

do not return 0 from ll_revalidate_nd in case of error:
invalidated dentry may get recreated and
real_lookup will revalidate agai instead of lookup. That revalidate oopses
derefencing error code in the line:
nd->intent.open.file->private_data = it; because nd->intent.open.file holds
error from first revalidate.

lustre/llite/dcache.c

index 7602d80..9b2fe52 100644 (file)
@@ -719,7 +719,7 @@ int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd)
                                 nd->intent.open.file->private_data = it;
                                 filp = lookup_instantiate_filp(nd, dentry,NULL);
                                 if (IS_ERR(filp)) {
-                                        rc = 0;
+                                        rc = PTR_ERR(filp);
                                 }
 #else
                                 nd->intent.open.file->private_data = it;