From 19e0548337d604afd97297e4ad195ff26b3ea681 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 14 Dec 2010 23:44:39 -0700 Subject: [PATCH] b=16605 verify object group before using it 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 530762d..0acb373 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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]; -- 1.8.3.1