Whamcloud - gitweb
LU-15143 osd-ldiskfs: osd_declare_write() underestimates credits 28/45328/3
authorAndrew Perepechko <andrew.perepechko@hpe.com>
Thu, 21 Oct 2021 19:40:39 +0000 (22:40 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Nov 2021 06:24:35 +0000 (06:24 +0000)
osd_declare_write() seems to underestimate journal credits for
the extent case. It does not properly account credits for
a new extent tree block. 3 credits (bitmap, gd, self) should be
accounted for a new data block and for a new extent tree block.

Change-Id: Iad463cac3a2a8c2b2a6b1a634e7502039bb1b7e5
HPE-bug-id: LUS-10514
Signed-off-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-on: https://review.whamcloud.com/45328
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_io.c

index 52ff06b..dc4208a 100644 (file)
@@ -1956,7 +1956,7 @@ static ssize_t osd_declare_write(const struct lu_env *env, struct dt_object *dt,
                 * level.
                 */
                depth = inode != NULL ? ext_depth(inode) : 0;
                 * level.
                 */
                depth = inode != NULL ? ext_depth(inode) : 0;
-               depth = min(max(depth, 1) + 1, LDISKFS_MAX_EXTENT_DEPTH);
+               depth = min(max(depth, 1) + 3, LDISKFS_MAX_EXTENT_DEPTH);
                credits = depth;
                /* if not append, then split may need to modify
                 * existing blocks moving entries into the new ones
                credits = depth;
                /* if not append, then split may need to modify
                 * existing blocks moving entries into the new ones