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

osd-ldiskfs fills file offsets into lnb->offset fields used as page offsets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • Lustre 2.4.0
    • Lustre 2.4.0
    • 3
    • 3988

    Description

      This affects ofd + osd-ldiskfs but not obdfilter or current MDS/MGS stack.

      static int osd_map_remote_to_local(loff_t offset, ssize_t len, int *nrpages,
                                         struct niobuf_local *lnb)
      {
              ENTRY;
      
              *nrpages = 0;  
      
              while (len > 0) {
                      int poff = offset & (CFS_PAGE_SIZE - 1);
                      int plen = CFS_PAGE_SIZE - poff;
      
                      if (plen > len)
                              plen = len;
                      lnb->offset = offset;
                      /* lnb->lnb_page_offset = poff; */
      

      "offset" contains the file offset, while "lnb->offset" is expected to be the page offset:

      static int osd_write_prep(const struct lu_env *env, struct dt_object *dt,
                                struct niobuf_local *lnb, int npages)
      {
      [...]
      
                      if (maxidx >= lnb[i].page->index) {
                              osd_iobuf_add_page(iobuf, lnb[i].page);
                      } else {
                              long off;
                              char *p = kmap(lnb[i].page);
      
                              off = lnb[i].offset;
                              if (off)
                                      memset(p, 0, off);
      

      The memset() call might zero out quite a number of pages that may not belong to Lustre.

      Attachments

        Issue Links

          Activity

            People

              liwei Li Wei (Inactive)
              liwei Li Wei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: