Whamcloud - gitweb
LU-10198 llog: keep llog handle alive until last reference 14/37514/4
authorMikhail Pershin <mpershin@whamcloud.com>
Wed, 29 Jan 2020 21:22:07 +0000 (00:22 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 06:16:02 +0000 (06:16 +0000)
commit4e3d745f82d0acf583975f7fbfcd3ce8841e9b9c
tree142e1d675672b26e534c430b883f0038b61bda82
parent10a799263964422df575038d3dfb507a09bfa221
LU-10198 llog: keep llog handle alive until last reference

Llog handle keeps related dt_object pinned until llog_close()
call, meanwhile llog handle can still have other users which
took llog handle via llog_cat_id2handle()

Patch changes llog_handle_put() to call lop_close() upon last
reference drop. So llog_osd_close() will put dt_object only
when llog_handle has no more references.
The llog_handle_get() checks and reports if llog_handle has
zero reference.
Also patch modifies checks for destroyed llogs, llog handle
has new lgh_destroyed flag which is set when llog is destroyed,
llog_osd_exist() checks dt_object_exist() and lgh_destroyed
flag, so destroyed llogs are considered as non-existent too.
Previously it uses lu_object_is_dying() check which is not
reliable because means only that object is not to be kept in
cache.

Lustre-change: https://review.whamcloud.com/37367
Lustre-commit: d6bd5e9cc49b3bb9901ada503107e8b0eca44f7e

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: If7df41646c243c0d40b20a30a33e86c688d24508
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37514
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_log.h
lustre/obdclass/llog.c
lustre/obdclass/llog_cat.c
lustre/obdclass/llog_internal.h
lustre/obdclass/llog_ioctl.c
lustre/obdclass/llog_osd.c