Whamcloud - gitweb
Branch: b1_4
authoradilger <adilger>
Sat, 23 Apr 2005 00:15:10 +0000 (00:15 +0000)
committeradilger <adilger>
Sat, 23 Apr 2005 00:15:10 +0000 (00:15 +0000)
Proper fix for hokey error message quieting hack, per Nathan's feedback.

lustre/obdfilter/filter.c
lustre/obdfilter/filter_internal.h

index 8a66895..1708066 100644 (file)
@@ -1644,7 +1644,7 @@ static int filter_disconnect(struct obd_export *exp)
 }
 
 struct dentry *__filter_oa2dentry(struct obd_device *obd,
-                                  struct obdo *oa, const char *what)
+                                  struct obdo *oa, const char *what, int quiet)
 {
         struct dentry *dchild = NULL;
         obd_gr group = 0;
@@ -1659,9 +1659,10 @@ struct dentry *__filter_oa2dentry(struct obd_device *obd,
                 RETURN(dchild);
         }
 
-        if (dchild->d_inode == NULL && strcmp(what, "filter_setattr")) {
-                CERROR("%s: %s on non-existent object: "LPU64"\n",
-                       obd->obd_name, what, oa->o_id);
+        if (dchild->d_inode == NULL) {
+                if (!quiet)
+                        CERROR("%s: %s on non-existent object: "LPU64"\n",
+                               obd->obd_name, what, oa->o_id);
                 f_dput(dchild);
                 RETURN(ERR_PTR(-ENOENT));
         }
@@ -1714,7 +1715,7 @@ static int filter_setattr(struct obd_export *exp, struct obdo *oa,
         int rc, rc2;
         ENTRY;
 
-        dentry = filter_oa2dentry(exp->exp_obd, oa);
+        dentry = __filter_oa2dentry(exp->exp_obd, oa, __FUNCTION__, 1);
         if (IS_ERR(dentry))
                 RETURN(PTR_ERR(dentry));
 
index e90fb60..a0fcee7 100644 (file)
@@ -100,8 +100,8 @@ void f_dput(struct dentry *);
 struct dentry *filter_fid2dentry(struct obd_device *, struct dentry *dir,
                                  obd_gr group, obd_id id);
 struct dentry *__filter_oa2dentry(struct obd_device *obd, struct obdo *oa,
-                                  const char *what);
-#define filter_oa2dentry(obd, oa) __filter_oa2dentry(obd, oa, __FUNCTION__)
+                                  const char *what, int quiet);
+#define filter_oa2dentry(obd, oa) __filter_oa2dentry(obd, oa, __FUNCTION__, 0)
 
 int filter_finish_transno(struct obd_export *, struct obd_trans_info *, int rc);
 __u64 filter_next_id(struct filter_obd *, struct obdo *);