Merge branch 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Nov 2018 02:58:52 +0000 (19:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Nov 2018 02:58:52 +0000 (19:58 -0700)
Pull AFS updates from Al Viro:
 "AFS series, with some iov_iter bits included"

* 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
  missing bits of "iov_iter: Separate type from direction and use accessor functions"
  afs: Probe multiple fileservers simultaneously
  afs: Fix callback handling
  afs: Eliminate the address pointer from the address list cursor
  afs: Allow dumping of server cursor on operation failure
  afs: Implement YFS support in the fs client
  afs: Expand data structure fields to support YFS
  afs: Get the target vnode in afs_rmdir() and get a callback on it
  afs: Calc callback expiry in op reply delivery
  afs: Fix FS.FetchStatus delivery from updating wrong vnode
  afs: Implement the YFS cache manager service
  afs: Remove callback details from afs_callback_break struct
  afs: Commit the status on a new file/dir/symlink
  afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS
  afs: Don't invoke the server to read data beyond EOF
  afs: Add a couple of tracepoints to log I/O errors
  afs: Handle EIO from delivery function
  afs: Fix TTL on VL server and address lists
  afs: Implement VL server rotation
  afs: Improve FS server rotation error handling
  ...

27 files changed:
1  2 
block/bio.c
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_receiver.c
drivers/block/loop.c
drivers/nvme/target/io-cmd-file.c
drivers/target/iscsi/iscsi_target_util.c
fs/9p/vfs_dir.c
fs/ceph/file.c
fs/cifs/connect.c
fs/cifs/file.c
fs/cifs/misc.c
fs/cifs/smb2ops.c
fs/cifs/smbdirect.c
fs/cifs/transport.c
fs/fuse/file.c
fs/iomap.c
fs/nfsd/vfs.c
fs/orangefs/inode.c
mm/filemap.c
mm/page_io.c
net/9p/client.c
net/9p/trans_virtio.c
net/ceph/messenger.c
net/socket.c
net/sunrpc/svcsock.c
net/tipc/topsrv.c
net/tls/tls_sw.c

diff --cc block/bio.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/9p/vfs_dir.c
Simple merge
diff --cc fs/ceph/file.c
index f788496fafcc9eeab5907cdcd7c68b16e0aecf8a,5dd433aa9b234deeed504d32ff5927f624baba69..27cad84dab23a9cf94008b3c76bff5440e7780ec
@@@ -594,103 -658,48 +594,103 @@@ static ssize_t ceph_sync_read(struct ki
        if (ret < 0)
                return ret;
  
 -      if (unlikely(iov_iter_is_pipe(to))) {
 +      ret = 0;
 +      while ((len = iov_iter_count(to)) > 0) {
 +              struct ceph_osd_request *req;
 +              struct page **pages;
 +              int num_pages;
                size_t page_off;
 -              ret = iov_iter_get_pages_alloc(to, &pages, len,
 -                                             &page_off);
 -              if (ret <= 0)
 -                      return -ENOMEM;
 -              num_pages = DIV_ROUND_UP(ret + page_off, PAGE_SIZE);
 +              u64 i_size;
 +              bool more;
 +
 +              req = ceph_osdc_new_request(osdc, &ci->i_layout,
 +                                      ci->i_vino, off, &len, 0, 1,
 +                                      CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ,
 +                                      NULL, ci->i_truncate_seq,
 +                                      ci->i_truncate_size, false);
 +              if (IS_ERR(req)) {
 +                      ret = PTR_ERR(req);
 +                      break;
 +              }
 +
 +              more = len < iov_iter_count(to);
  
-               if (unlikely(to->type & ITER_PIPE)) {
 -              ret = striped_read(inode, off, ret, pages, num_pages,
 -                                 page_off, checkeof);
 -              if (ret > 0) {
 -                      iov_iter_advance(to, ret);
 -                      off += ret;
++              if (unlikely(iov_iter_is_pipe(to))) {
 +                      ret = iov_iter_get_pages_alloc(to, &pages, len,
 +                                                     &page_off);
 +                      if (ret <= 0) {
 +                              ceph_osdc_put_request(req);
 +                              ret = -ENOMEM;
 +                              break;
 +                      }
 +                      num_pages = DIV_ROUND_UP(ret + page_off, PAGE_SIZE);
 +                      if (ret < len) {
 +                              len = ret;
 +                              osd_req_op_extent_update(req, 0, len);
 +                              more = false;
 +                      }
                } else {
 -                      iov_iter_advance(to, 0);
 +                      num_pages = calc_pages_for(off, len);
 +                      page_off = off & ~PAGE_MASK;
 +                      pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL);
 +                      if (IS_ERR(pages)) {
 +                              ceph_osdc_put_request(req);
 +                              ret = PTR_ERR(pages);
 +                              break;
 +                      }
                }
 -              ceph_put_page_vector(pages, num_pages, false);
 -      } else {
 -              num_pages = calc_pages_for(off, len);
 -              pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL);
 -              if (IS_ERR(pages))
 -                      return PTR_ERR(pages);
 -
 -              ret = striped_read(inode, off, len, pages, num_pages,
 -                                 (off & ~PAGE_MASK), checkeof);
 -              if (ret > 0) {
 -                      int l, k = 0;
 -                      size_t left = ret;
 -
 -                      while (left) {
 -                              size_t page_off = off & ~PAGE_MASK;
 -                              size_t copy = min_t(size_t, left,
 -                                                  PAGE_SIZE - page_off);
 -                              l = copy_page_to_iter(pages[k++], page_off,
 -                                                    copy, to);
 -                              off += l;
 -                              left -= l;
 -                              if (l < copy)
 +
 +              osd_req_op_extent_osd_data_pages(req, 0, pages, len, page_off,
 +                                               false, false);
 +              ret = ceph_osdc_start_request(osdc, req, false);
 +              if (!ret)
 +                      ret = ceph_osdc_wait_request(osdc, req);
 +              ceph_osdc_put_request(req);
 +
 +              i_size = i_size_read(inode);
 +              dout("sync_read %llu~%llu got %zd i_size %llu%s\n",
 +                   off, len, ret, i_size, (more ? " MORE" : ""));
 +
 +              if (ret == -ENOENT)
 +                      ret = 0;
 +              if (ret >= 0 && ret < len && (off + ret < i_size)) {
 +                      int zlen = min(len - ret, i_size - off - ret);
 +                      int zoff = page_off + ret;
 +                      dout("sync_read zero gap %llu~%llu\n",
 +                             off + ret, off + ret + zlen);
 +                      ceph_zero_page_vector_range(zoff, zlen, pages);
 +                      ret += zlen;
 +              }
 +
-               if (unlikely(to->type & ITER_PIPE)) {
++              if (unlikely(iov_iter_is_pipe(to))) {
 +                      if (ret > 0) {
 +                              iov_iter_advance(to, ret);
 +                              off += ret;
 +                      } else {
 +                              iov_iter_advance(to, 0);
 +                      }
 +                      ceph_put_page_vector(pages, num_pages, false);
 +              } else {
 +                      int idx = 0;
 +                      size_t left = ret > 0 ? ret : 0;
 +                      while (left > 0) {
 +                              size_t len, copied;
 +                              page_off = off & ~PAGE_MASK;
 +                              len = min_t(size_t, left, PAGE_SIZE - page_off);
 +                              copied = copy_page_to_iter(pages[idx++],
 +                                                         page_off, len, to);
 +                              off += copied;
 +                              left -= copied;
 +                              if (copied < len) {
 +                                      ret = -EFAULT;
                                        break;
 +                              }
                        }
 +                      ceph_release_page_vector(pages, num_pages);
                }
 -              ceph_release_page_vector(pages, num_pages);
 +
 +              if (ret <= 0 || off >= i_size || !more)
 +                      break;
        }
  
        if (off > iocb->ki_pos) {
Simple merge
diff --cc fs/cifs/file.c
Simple merge
diff --cc fs/cifs/misc.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/fuse/file.c
Simple merge
diff --cc fs/iomap.c
Simple merge
diff --cc fs/nfsd/vfs.c
Simple merge
Simple merge
diff --cc mm/filemap.c
Simple merge
diff --cc mm/page_io.c
Simple merge
diff --cc net/9p/client.c
Simple merge
Simple merge
Simple merge
diff --cc net/socket.c
Simple merge
index 3b525accaa6857bc76cda9a8b9f131791fcd1f26,1c1e52964edbfb3c79c61e82d6527b28ffccd269..986f3ed7d1a24800d31713143aebffc45e32fc16
@@@ -336,12 -338,8 +336,12 @@@ static ssize_t svc_recvfrom(struct svc_
        rqstp->rq_xprt_hlen = 0;
  
        clear_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
-       iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, iov, nr, buflen);
+       iov_iter_kvec(&msg.msg_iter, READ, iov, nr, buflen);
 -      len = sock_recvmsg(svsk->sk_sock, &msg, msg.msg_flags);
 +      if (base != 0) {
 +              iov_iter_advance(&msg.msg_iter, base);
 +              buflen -= base;
 +      }
 +      len = sock_recvmsg(svsk->sk_sock, &msg, MSG_DONTWAIT);
        /* If we read a full record, then assume there may be more
         * data to read (stream based sockets only!)
         */
Simple merge
Simple merge