Whamcloud - gitweb
LU-14911 osp: release thandle if it was created 04/44504/7
authorAlex Zhuravlev <bzzz@whamcloud.com>
Thu, 5 Aug 2021 05:52:53 +0000 (08:52 +0300)
committerOleg Drokin <green@whamcloud.com>
Sun, 10 Oct 2021 03:31:18 +0000 (03:31 +0000)
osp_statfs_update() could leak thandle if transaction couldn't
start for a reason.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I541a5e4a7860008eb179d905ac57997b737f178c
Reviewed-on: https://review.whamcloud.com/44504
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/osp_precreate.c

index 7105cfb..805f87d 100644 (file)
@@ -262,8 +262,8 @@ static int osp_statfs_update(const struct lu_env *env, struct osp_device *d)
                               d->opd_obd->obd_name,
                               atomic_read(&d->opd_sync_changes));
                        osp_sync_add_commit_cb_1s(env, d, th);
                               d->opd_obd->obd_name,
                               atomic_read(&d->opd_sync_changes));
                        osp_sync_add_commit_cb_1s(env, d, th);
-                       dt_trans_stop(env, d->opd_storage, th);
                }
                }
+               dt_trans_stop(env, d->opd_storage, th);
        }
 
 out:
        }
 
 out: