Whamcloud - gitweb
LU-8686 osd: add few more credits if debugging is enabled 44/23044/4
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Mon, 10 Oct 2016 10:07:13 +0000 (13:07 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 1 Mar 2017 05:12:42 +0000 (05:12 +0000)
this can make JBD happy, prevent panic and let OSD detect
credits overuse.

Change-Id: I93fae9bd0d8208af888b75232eb9b9cde205a98f
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: https://review.whamcloud.com/23044
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osd-ldiskfs/osd_handler.c

index a928e77..7b19f07 100644 (file)
@@ -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);
        }
 
         /*