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

Don't restart CLI IO for IOCB_NOWAIT direct IO

    XMLWordPrintable

Details

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

    Description

      int cl_io_loop(const struct lu_env *env, struct cl_io *io)
      {
      	int result = 0;
      	int rc = 0;
      
             ...
            if (result == -EAGAIN && io->ci_ndelay) {
      		io->ci_need_restart = 1;
      		result = 0;
      	}
      
      	if (result == 0)
      		result = io->ci_result;
      	RETURN(result < 0 ? result : 0);
      }
      EXPORT_SYMBOL(cl_io_loop);
      
      ssize_t
      generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
      {
      ...
                 if (iocb->ki_flags & IOCB_NOWAIT) {
      			if (filemap_range_has_page(mapping, iocb->ki_pos,
      						   iocb->ki_pos + count - 1))
      				return -EAGAIN;
                     ...
      

      We should handle FLR mirror retry and io_uring IOCB_NOWAIT differently.

      In the current code, it will restart the I/O engine loop when get -EAGAIN return code.
      When io_uring with IOCB_NOWAIT flags and found there are page cache in the I/O range, we should return the -EAGAIN to the caller immediately.
      Otherwise, it will Stuck in an endless loop。

      Attachments

        Issue Links

          Activity

            People

              qian_wc Qian Yingjin
              qian_wc Qian Yingjin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: