From 4ea2fd026686de178162ac2ebdad8668837f9ca4 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 27 Sep 2005 23:46:59 +0000 Subject: [PATCH] Branch b1_4 Description: MDS may oops in groups_free() Details : in rare race conditions a newly allocated group_info struct is freed again, and this can be NULL. The 2.4 compatibility code for groups_free() checked for a NULL pointer, but 2.6 did not. b=7273 --- lustre/ChangeLog | 8 ++++++++ lustre/lvfs/upcall_cache.c | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 4b64143..d267673 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -128,6 +128,14 @@ Description: improve by-nid export eviction on the MDS and OST Details : allow multiple exports with the same NID to be evicted at one time without re-searching the exports list. +Severity : major +Frequency : rare, only with supplementary groups enabled on SMP 2.6 kernels +Bugzilla : 7273 +Description: MDS may oops in groups_free() +Details : in rare race conditions a newly allocated group_info struct is + freed again, and this can be NULL. The 2.4 compatibility code + for groups_free() checked for a NULL pointer, but 2.6 did not. + ------------------------------------------------------------------------------ 08-26-2005 Cluster File Systems, Inc. diff --git a/lustre/lvfs/upcall_cache.c b/lustre/lvfs/upcall_cache.c index a8bb2b6..ea33ee7 100644 --- a/lustre/lvfs/upcall_cache.c +++ b/lustre/lvfs/upcall_cache.c @@ -66,9 +66,6 @@ struct group_info *groups_alloc(int ngroups) void groups_free(struct group_info *ginfo) { - if (!ginfo) - return; - LASSERT(ginfo->ngroups <= NGROUPS_SMALL); LASSERT(ginfo->nblocks == 1); LASSERT(ginfo->blocks[0] == ginfo->small_block); @@ -96,7 +93,8 @@ static struct upcall_cache_entry *alloc_entry(__u64 key) /* protected by hash lock */ static void free_entry(struct upcall_cache_entry *entry) { - groups_free(entry->ue_group_info); + if (entry->ue_group_info) + groups_free(entry->ue_group_info); list_del(&entry->ue_hash); CDEBUG(D_OTHER, "destroy cache entry %p for key "LPU64"\n", entry, entry->ue_key); -- 1.8.3.1