Whamcloud - gitweb
LU-10527 obdclass: don't recycle loghandle upon ENOSPC 50/33850/3
authorBruno Faccini <bruno.faccini@intel.com>
Wed, 17 Jan 2018 15:22:58 +0000 (16:22 +0100)
committerOleg Drokin <green@whamcloud.com>
Sat, 5 Jan 2019 06:51:52 +0000 (06:51 +0000)
commit51e962be60cf599ecf154ea3a6b1c0f9882daac2
tree65a462692c69b89fe2eb3b661fe09aa40ef62882
parent14060cdc202b2ca37429f35c763fffd34829ec21
LU-10527 obdclass: don't recycle loghandle upon ENOSPC

In llog_cat_add_rec(), upon -ENOSPC error being returned from
llog_cat_new_log(), don't reset "cathandle->u.chd.chd_current_log"
to NULL.
Not doing so will avoid to have llog_cat_declare_add_rec() repeatedly
and unnecessarily create new+partially initialized LLOGs/llog_handle
and assigned to "cathandle->u.chd.chd_current_log", this without
llog_init_handle() never being called to initialize
"loghandle->lgh_hdr".

Also, unnecessary LASSERT(llh) has been removed in
llog_cat_current_log() as it prevented to gracefully handle this
case by simply returning the loghandle.
Thanks to S.Cheremencev (Cray) to report this.

Both ways to fix have been kept in patch as the 1st part allows for
better performance in terms of number of FS operations being done
with permanent changelog's ENOSPC condition, even if this covers
a somewhat unlikely situation.

Lustre-commit: 5761b9576d39c44c02455b86eb86ce1276930e60
Lustre-change: https://review.whamcloud.com/30897

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I526f788dc283fa7136ba518179d9337e1d5e3714
Reviewed-by: Sergey Cheremencev <c17829@cray.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33850
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/obdclass/llog_cat.c