From 97710bec755d346d7a64691f96e935b8ee04f8b0 Mon Sep 17 00:00:00 2001 From: nikita Date: Sun, 7 May 2006 23:11:29 +0000 Subject: [PATCH] osd: fix osd_trans_stop() to release reference to device --- lustre/osd/osd_handler.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index e85ff94..ac69677 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -280,18 +280,27 @@ static void osd_trans_stop(struct lu_context *ctx, struct thandle *th) { int result; struct osd_thandle *oh; + struct thandle *th; ENTRY; oh = container_of0(th, struct osd_thandle, ot_super); - /* - * XXX temporary stuff. Some abstraction layer should be used. - */ - /* - * XXX Here, run transaction stop hook. - */ - result = journal_stop(oh->ot_handle); - if (result != 0) - CERROR("Failure to stop transaction: %d\n", result); + th = &oh->ot_super; + if (oh->ot_handle != NULL) { + /* + * XXX temporary stuff. Some abstraction layer should be used. + */ + /* + * XXX Here, run transaction stop hook. + */ + result = journal_stop(oh->ot_handle); + if (result != 0) + CERROR("Failure to stop transaction: %d\n", result); + oh->ot_handle = NULL; + } + if (th->th_dev != NULL) { + lu_device_put(&th->th_dev->dd_lu_dev); + th->th_dev = NULL; + } EXIT; } -- 1.8.3.1