From: Alex Zhuravlev Date: Mon, 10 Oct 2016 10:07:13 +0000 (+0300) Subject: LU-8686 osd: add few more credits if debugging is enabled X-Git-Tag: 2.9.54~18 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=cc3944819b05d1f2df547c19ce59a5422eb414bd LU-8686 osd: add few more credits if debugging is enabled this can make JBD happy, prevent panic and let OSD detect credits overuse. Change-Id: I93fae9bd0d8208af888b75232eb9b9cde205a98f Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/23044 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Andreas Dilger --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index a928e77..7b19f07 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -1709,6 +1709,14 @@ static int osd_trans_start(const struct lu_env *env, struct dt_device *d, * This should be removed when we can calculate the * credits precisely. */ oh->ot_credits = osd_transaction_size(dev); + } else if (ldiskfs_track_declares_assert != 0) { + /* reserve few credits to prevent an assertion in JBD + * our debugging mechanism will be able to detected + * overuse. this can help to debug single-update + * transactions */ + oh->ot_credits += 10; + if (unlikely(osd_param_is_not_sane(dev, th))) + oh->ot_credits = osd_transaction_size(dev); } /*