Commit b85900e9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull NFS client updates from Trond Myklebust:
 "Bugfixes:

   - Fix handling of ENOSPC so that if we have to resend writes, they
     are written synchronously

   - SUNRPC RDMA transport fixes from Chuck

   - Several fixes for delegated timestamps in NFSv4.2

   - Failure to obtain a directory delegation should not cause stat() to
     fail with NFSv4

   - Rename was failing to update timestamps when a directory delegation
     is held on NFSv4

   - Ensure we check rsize/wsize after crossing a NFSv4 filesystem
     boundary

   - NFSv4/pnfs:

      - If the server is down, retry the layout returns on reboot

      - Fallback to MDS could result in a short write being incorrectly
        logged

  Cleanups:

   - Use memcpy_and_pad in decode_fh"

* tag 'nfs-for-7.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (21 commits)
  NFS: Fix RCU dereference of cl_xprt in nfs_compare_super_address
  NFS: remove redundant __private attribute from nfs_page_class
  NFSv4.2: fix CLONE/COPY attrs in presence of delegated attributes
  NFS: fix writeback in presence of errors
  nfs: use memcpy_and_pad in decode_fh
  NFSv4.1: Apply session size limits on clone path
  NFSv4: retry GETATTR if GET_DIR_DELEGATION failed
  NFS: fix RENAME attr in presence of directory delegations
  pnfs/flexfiles: validate ds_versions_cnt is non-zero
  NFS/blocklayout: print each device used for SCSI layouts
  xprtrdma: Post receive buffers after RPC completion
  xprtrdma: Scale receive batch size with credit window
  xprtrdma: Replace rpcrdma_mr_seg with xdr_buf cursor
  xprtrdma: Decouple frwr_wp_create from frwr_map
  xprtrdma: Close lost-wakeup race in xprt_rdma_alloc_slot
  xprtrdma: Avoid 250 ms delay on backlog wakeup
  xprtrdma: Close sendctx get/put race that can block a transport
  nfs: update inode ctime after removexattr operation
  nfs: fix utimensat() for atime with delegated timestamps
  NFS: improve "Server wrote zero bytes" error
  ...
parents ac2dc6d5 e6614b88
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -370,11 +370,14 @@ bl_open_path(struct pnfs_block_volume *v, const char *prefix)
	if (!devname)
		return ERR_PTR(-ENOMEM);

	bdev_file = bdev_file_open_by_path(devname, BLK_OPEN_READ | BLK_OPEN_WRITE,
					NULL, NULL);
	bdev_file = bdev_file_open_by_path(devname,
			BLK_OPEN_READ | BLK_OPEN_WRITE, NULL, NULL);
	if (IS_ERR(bdev_file)) {
		dprintk("failed to open device %s (%ld)\n",
			devname, PTR_ERR(bdev_file));
	} else {
		pr_info("pNFS: using block device %s\n",
			file_bdev(bdev_file)->bd_disk->disk_name);
	}

	kfree(devname);
+1 −2
Original line number Diff line number Diff line
@@ -96,8 +96,7 @@ static __be32 decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh)
	p = xdr_inline_decode(xdr, fh->size);
	if (unlikely(p == NULL))
		return htonl(NFS4ERR_RESOURCE);
	memcpy(&fh->data[0], p, fh->size);
	memset(&fh->data[fh->size], 0, sizeof(fh->data) - fh->size);
	memcpy_and_pad(fh->data, sizeof(fh->data), p, fh->size, 0);
	return 0;
}

+5 −0
Original line number Diff line number Diff line
@@ -97,6 +97,11 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
	if (unlikely(!p))
		goto out_err_drain_dsaddrs;
	version_count = be32_to_cpup(p);

	if (version_count == 0) {
		ret = -EINVAL;
		goto out_err_drain_dsaddrs;
	}
	dprintk("%s: version count %d\n", __func__, version_count);

	ds_versions = kzalloc_objs(struct nfs4_ff_ds_version, version_count,
+3 −9
Original line number Diff line number Diff line
@@ -692,7 +692,8 @@ void nfs_update_delegated_atime(struct inode *inode)

void nfs_update_delegated_mtime_locked(struct inode *inode)
{
	if (nfs_have_delegated_mtime(inode))
	if (nfs_have_delegated_mtime(inode) ||
	    nfs_have_directory_delegation(inode))
		nfs_update_mtime(inode);
}

@@ -757,14 +758,7 @@ nfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
	} else if (nfs_have_delegated_atime(inode) &&
		   attr->ia_valid & ATTR_ATIME &&
		   !(attr->ia_valid & ATTR_MTIME)) {
		if (attr->ia_valid & ATTR_ATIME_SET) {
			if (uid_eq(task_uid, owner_uid)) {
				spin_lock(&inode->i_lock);
				nfs_set_timestamps_to_ts(inode, attr);
				spin_unlock(&inode->i_lock);
				attr->ia_valid &= ~(ATTR_ATIME|ATTR_ATIME_SET);
			}
		} else {
		if (!(attr->ia_valid & ATTR_ATIME_SET)) {
			nfs_update_delegated_atime(inode);
			attr->ia_valid &= ~ATTR_ATIME;
		}
+2 −0
Original line number Diff line number Diff line
@@ -253,6 +253,8 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
					     u32 minor_version);
extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *,
						struct inode *);
extern void nfs4_session_limit_rwsize(struct nfs_server *server);
extern void nfs4_session_limit_xasize(struct nfs_server *server);
extern struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
			const struct sockaddr_storage *ds_addr, int ds_addrlen,
			int ds_proto, unsigned int ds_timeo,
Loading