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

cl_io_loop improperly assumes all ios are rw-type IOs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      cl_io_loop has this code:

                      pos   = io->u.ci_rw.rw_range.cir_pos;
                      count = io->u.ci_rw.rw_range.cir_count;
      
                      if (io->ci_pio) {
                              /* submit this range for parallel execution */
                              pt = cl_io_submit_pt(io, pos, count);
                              if (IS_ERR(pt)) {
                                      cl_io_iter_fini(env, io);
                                      rc = PTR_ERR(pt);
                                      break;
                              }
      
                              *tail = pt;
                              tail = &pt->cip_next;
                      } else {
                              size_t nob = io->ci_nob;
      
                              CDEBUG(D_VFSTRACE,
                                      "execute type %u range: [%llu, %llu) nob: %zu %s\n",
                                      io->ci_type, pos, pos + count, nob,
                                      io->ci_continue ? "continue" : "stop");
      

      Now the io->u.ci_rw. is only valid for accessing if the IO is of type CIT_READ/WRITE, otherwise the union is populated differently.

      And cl_io_loop IS called by other places, for example:

              if (cl_io_init(env, io, CIT_FSYNC, io->ci_obj) == 0)
                      result = cl_io_loop(env, io);
      

      The problematic code was introduced by LU-8964 - parallel io code.
      commit db59ecb5d1d0284fb918def6348a11e0966d7767

      Attachments

        Issue Links

          Activity

            People

              dmiter Dmitry Eremin (Inactive)
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: