Whamcloud - gitweb
b=16605 verify object group before using it
authorAndreas Dilger <andreas.dilger@oracle.com>
Wed, 15 Dec 2010 06:44:39 +0000 (23:44 -0700)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Fri, 17 Dec 2010 01:20:57 +0000 (04:20 +0300)
Avoid trying to access an invalid/unknown group sent from the client.
Don't return -EINVAL, since it is possible that the problem is the OST
code is old and this object actually exists.  Instead, return -EBADF
so that we can more easily diagnose this problem.

lustre/obdfilter/filter.c

index 530762d..0acb373 100644 (file)
@@ -1406,7 +1406,9 @@ struct dentry *filter_parent(struct obd_device *obd, obd_seq group, obd_id objid
 {
         struct filter_obd *filter = &obd->u.filter;
         struct filter_subdirs *subdirs;
-        LASSERT(group < filter->fo_group_count); /* FIXME: object groups */
+
+        if (group >= filter->fo_group_count) /* FIXME: object groups */
+               return ERR_PTR(-EBADF);
 
         if (!fid_seq_is_mdt(group) || filter->fo_subdir_count == 0)
                 return filter->fo_dentry_O_groups[group];