Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18987

Strange LASSERT in mdt_dom_read_on_open()

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.17.0
    • Lustre 2.17.0
    • None
    • 3
    • 9223372036854775807

    Description

      There's a strange code in mdt_dom_read_on_open (highlighted by smatch) that asserts for some non-sensical stuff that's not even changed inside the loop:

              rc = dt_read_prep(env, mo, lnb, nr_local);
              if (unlikely(rc))
                      GOTO(buf_put, rc);
              /* copy data to the buffer finally */
              for (i = 0; i < nr_local; i++) {
                      char *p = kmap(lnb[i].lnb_page);
                      long off;                LASSERT(lnb[i].lnb_page_offset == 0);
                      off = lnb[i].lnb_len & ~PAGE_MASK;
                      if (off > 0)
                              memset(p + off, 0, PAGE_SIZE - off);
                      memcpy(buf + (i << PAGE_SHIFT), p, lnb[i].lnb_len);
                      kunmap(lnb[i].lnb_page);
                      copied += lnb[i].lnb_len;
      ====>>>         LASSERT(rc <= len);        <<<<======= here
              }
      

      I checked with Mike (original path author) and he thinks we can just safely drop it.

      Attachments

        Issue Links

          Activity

            [LU-18987] Strange LASSERT in mdt_dom_read_on_open()
            pjones Peter Jones added a comment -

            Merged for 2.17

            pjones Peter Jones added a comment - Merged for 2.17

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/59173/
            Subject: LU-18987 mdt: Remove stray assertion for dom read
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 130792644e0d8047c60896df71f942f445dc3c37

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/59173/ Subject: LU-18987 mdt: Remove stray assertion for dom read Project: fs/lustre-release Branch: master Current Patch Set: Commit: 130792644e0d8047c60896df71f942f445dc3c37

            "Oleg Drokin <green@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/59173
            Subject: LU-18987 mdt: Remove stray assertion for dom read
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 0aaf7ab39823a07d6609af0b0e45c9d1c9b6daef

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/59173 Subject: LU-18987 mdt: Remove stray assertion for dom read Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 0aaf7ab39823a07d6609af0b0e45c9d1c9b6daef

            People

              green Oleg Drokin
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: