Whamcloud - gitweb
EX-9449 csdc: replace assert with error message
authorArtem Blagodarenko <ablagodarenko@ddn.com>
Tue, 16 Apr 2024 20:40:41 +0000 (21:40 +0100)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 1 May 2024 22:59:17 +0000 (22:59 +0000)
Remove assert, based on the data from the wire and replace
it to the error message, which be useful in case this
error happens.

The -EAGAIN error is reasonable in this case.

Signed-off-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Change-Id: I2f37d0204123af1c23352b967dad1de5e7860b64
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54817
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osd-ldiskfs/osd_io.c

index b96e771..137f94d 100644 (file)
@@ -1348,7 +1348,22 @@ static int osd_write_prep(const struct lu_env *env, struct dt_object *dt,
                 * been read up, so we should never add one here for the
                 * partial page reads
                 */
-               LASSERT(!(lnb[i].lnb_flags & OBD_BRW_COMPRESSED));
+               if (unlikely(ldiskfs_track_declares_assert)) {
+                       LASSERTF(!(lnb[i].lnb_flags & OBD_BRW_COMPRESSED),
+                                "%s: obj "DFID" uncompressed page at offset %llu (%u+%u)\n",
+                                osd_ino2name(inode),
+                                PFID(lu_object_fid(&dt->do_lu)),
+                                lnb[i].lnb_file_offset, lnb[i].lnb_page_offset,
+                                lnb[i].lnb_len);
+               } else if (unlikely(lnb[i].lnb_flags & OBD_BRW_COMPRESSED)) {
+                       rc = -EAGAIN;
+                       CERROR("%s: obj "DFID" uncompressed page at offset %llu (%u+%u): rc = %d\n",
+                              osd_ino2name(inode),
+                              PFID(lu_object_fid(&dt->do_lu)),
+                              lnb[i].lnb_file_offset, lnb[i].lnb_page_offset,
+                              lnb[i].lnb_len, rc);
+                       RETURN(rc);
+               }
 
                if (maxidx >= lnb[i].lnb_page->index) {
                        osd_iobuf_add_page(iobuf, &lnb[i]);