From 816fba360b0adf8bdebf86e2ad007e3c07886b04 Mon Sep 17 00:00:00 2001 From: yury Date: Tue, 1 Nov 2005 09:16:21 +0000 Subject: [PATCH] - fixed parent locking in filter_create_object(). Parent should be unlocked after child's inode fid EA is stored and transaction committed. Otherwise concurrent thread might access child object which is not realy ready (no fid EA) --- lustre/obdfilter/filter.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 51fe946..a392006 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -2182,7 +2182,6 @@ filter_create_object(struct obd_device *obd, struct obdo *oa) int cleanup_phase = 0; int err = 0, rc = 0; void *handle = NULL; - int parent_locked; obd_gr group = 0; ENTRY; @@ -2197,7 +2196,6 @@ filter_create_object(struct obd_device *obd, struct obdo *oa) if (IS_ERR(dparent)) GOTO(cleanup, dchild = dparent); cleanup_phase = 1; - parent_locked = 1; /* check if object is in blacklist. This should be done under parent * lock. */ @@ -2253,9 +2251,6 @@ filter_create_object(struct obd_device *obd, struct obdo *oa) rc = 0; } - filter_parent_unlock(obd, dparent); - parent_locked = 0; - /* nobody else is touching this newly created object */ LASSERT(dchild->d_inode); @@ -2295,8 +2290,7 @@ cleanup: } } case 1: - if (parent_locked) - filter_parent_unlock(obd, dparent); + filter_parent_unlock(obd, dparent); case 0: break; } -- 1.8.3.1