Commit 0280e3c5 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs

Pull NFS client updates from Anna Schumaker:
 "New Features:

   - Basic handling for case insensitive filesystems

   - Initial support for fs_locations and server trunking

  Bugfixes and Cleanups:

   - Cleanups to how the "struct cred *" is handled for the
     nfs_access_entry

   - Ensure the server has an up to date ctimes before hardlinking or
     renaming

   - Update 'blocks used' after writeback, fallocate, and clone

   - nfs_atomic_open() fixes

   - Improvements to sunrpc tracing

   - Various null check & indenting related cleanups

   - Some improvements to the sunrpc sysfs code:
      - Use default_groups in kobj_type
      - Fix some potential races and reference leaks

   - A few tracepoint cleanups in xprtrdma"

[ This should have gone in during the merge window, but didn't. The
  original pull request - sent during the merge window - had gotten
  marked as spam and discarded due missing DKIM headers in the email
  from Anna.   - Linus ]

* tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (35 commits)
  SUNRPC: Don't dereference xprt->snd_task if it's a cookie
  xprtrdma: Remove definitions of RPCDBG_FACILITY
  xprtrdma: Remove final dprintk call sites from xprtrdma
  sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change()
  net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change
  NFSv4.1 test and add 4.1 trunking transport
  SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt
  NFSv4 handle port presence in fs_location server string
  NFSv4 expose nfs_parse_server_name function
  NFSv4.1 query for fs_location attr on a new file system
  NFSv4 store server support for fs_location attribute
  NFSv4 remove zero number of fs_locations entries error check
  NFSv4: nfs_atomic_open() can race when looking up a non-regular file
  NFSv4: Handle case where the lookup of a directory fails
  NFSv42: Fallocate and clone should also request 'blocks used'
  NFSv4: Allow writebacks to request 'blocks used'
  SUNRPC: use default_groups in kobj_type
  NFS: use default_groups in kobj_type
  NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open()
  NFS: Add a helper to remove case-insensitive aliases
  ...
parents 7938d615 aed28b7a
...@@ -170,7 +170,7 @@ struct cb_devicenotifyitem { ...@@ -170,7 +170,7 @@ struct cb_devicenotifyitem {
}; };
struct cb_devicenotifyargs { struct cb_devicenotifyargs {
int ndevs; uint32_t ndevs;
struct cb_devicenotifyitem *devs; struct cb_devicenotifyitem *devs;
}; };
......
...@@ -358,7 +358,7 @@ __be32 nfs4_callback_devicenotify(void *argp, void *resp, ...@@ -358,7 +358,7 @@ __be32 nfs4_callback_devicenotify(void *argp, void *resp,
struct cb_process_state *cps) struct cb_process_state *cps)
{ {
struct cb_devicenotifyargs *args = argp; struct cb_devicenotifyargs *args = argp;
int i; uint32_t i;
__be32 res = 0; __be32 res = 0;
struct nfs_client *clp = cps->clp; struct nfs_client *clp = cps->clp;
struct nfs_server *server = NULL; struct nfs_server *server = NULL;
......
...@@ -258,11 +258,9 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, ...@@ -258,11 +258,9 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
void *argp) void *argp)
{ {
struct cb_devicenotifyargs *args = argp; struct cb_devicenotifyargs *args = argp;
uint32_t tmp, n, i;
__be32 *p; __be32 *p;
__be32 status = 0; __be32 status = 0;
u32 tmp;
int n, i;
args->ndevs = 0;
/* Num of device notifications */ /* Num of device notifications */
p = xdr_inline_decode(xdr, sizeof(uint32_t)); p = xdr_inline_decode(xdr, sizeof(uint32_t));
...@@ -271,7 +269,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, ...@@ -271,7 +269,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
goto out; goto out;
} }
n = ntohl(*p++); n = ntohl(*p++);
if (n <= 0) if (n == 0)
goto out; goto out;
if (n > ULONG_MAX / sizeof(*args->devs)) { if (n > ULONG_MAX / sizeof(*args->devs)) {
status = htonl(NFS4ERR_BADXDR); status = htonl(NFS4ERR_BADXDR);
...@@ -330,19 +328,21 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, ...@@ -330,19 +328,21 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
dev->cbd_immediate = 0; dev->cbd_immediate = 0;
} }
args->ndevs++;
dprintk("%s: type %d layout 0x%x immediate %d\n", dprintk("%s: type %d layout 0x%x immediate %d\n",
__func__, dev->cbd_notify_type, dev->cbd_layout_type, __func__, dev->cbd_notify_type, dev->cbd_layout_type,
dev->cbd_immediate); dev->cbd_immediate);
} }
args->ndevs = n;
dprintk("%s: ndevs %d\n", __func__, args->ndevs);
return 0;
err:
kfree(args->devs);
out: out:
args->devs = NULL;
args->ndevs = 0;
dprintk("%s: status %d ndevs %d\n", dprintk("%s: status %d ndevs %d\n",
__func__, ntohl(status), args->ndevs); __func__, ntohl(status), args->ndevs);
return status; return status;
err:
kfree(args->devs);
goto out;
} }
static __be32 decode_sessionid(struct xdr_stream *xdr, static __be32 decode_sessionid(struct xdr_stream *xdr,
......
...@@ -856,6 +856,13 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str ...@@ -856,6 +856,13 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
server->namelen = pathinfo.max_namelen; server->namelen = pathinfo.max_namelen;
} }
if (clp->rpc_ops->discover_trunking != NULL &&
(server->caps & NFS_CAP_FS_LOCATIONS)) {
error = clp->rpc_ops->discover_trunking(server, mntfh);
if (error < 0)
return error;
}
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -51,7 +51,7 @@ struct nfs4_file_layout_dsaddr { ...@@ -51,7 +51,7 @@ struct nfs4_file_layout_dsaddr {
u32 stripe_count; u32 stripe_count;
u8 *stripe_indices; u8 *stripe_indices;
u32 ds_num; u32 ds_num;
struct nfs4_pnfs_ds *ds_list[1]; struct nfs4_pnfs_ds *ds_list[];
}; };
struct nfs4_filelayout_segment { struct nfs4_filelayout_segment {
......
...@@ -136,9 +136,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, ...@@ -136,9 +136,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
goto out_err_free_stripe_indices; goto out_err_free_stripe_indices;
} }
dsaddr = kzalloc(sizeof(*dsaddr) + dsaddr = kzalloc(struct_size(dsaddr, ds_list, num), gfp_flags);
(sizeof(struct nfs4_pnfs_ds *) * (num - 1)),
gfp_flags);
if (!dsaddr) if (!dsaddr)
goto out_err_free_stripe_indices; goto out_err_free_stripe_indices;
......
...@@ -373,6 +373,7 @@ extern unsigned long nfs_access_cache_count(struct shrinker *shrink, ...@@ -373,6 +373,7 @@ extern unsigned long nfs_access_cache_count(struct shrinker *shrink,
extern unsigned long nfs_access_cache_scan(struct shrinker *shrink, extern unsigned long nfs_access_cache_scan(struct shrinker *shrink,
struct shrink_control *sc); struct shrink_control *sc);
struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int); struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);
void nfs_d_prune_case_insensitive_aliases(struct inode *inode);
int nfs_create(struct user_namespace *, struct inode *, struct dentry *, int nfs_create(struct user_namespace *, struct inode *, struct dentry *,
umode_t, bool); umode_t, bool);
int nfs_mkdir(struct user_namespace *, struct inode *, struct dentry *, int nfs_mkdir(struct user_namespace *, struct inode *, struct dentry *,
......
...@@ -220,7 +220,8 @@ static int nfs3_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle, ...@@ -220,7 +220,8 @@ static int nfs3_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle,
task_flags); task_flags);
} }
static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry,
const struct cred *cred)
{ {
struct nfs3_accessargs arg = { struct nfs3_accessargs arg = {
.fh = NFS_FH(inode), .fh = NFS_FH(inode),
...@@ -231,7 +232,7 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) ...@@ -231,7 +232,7 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry)
.rpc_proc = &nfs3_procedures[NFS3PROC_ACCESS], .rpc_proc = &nfs3_procedures[NFS3PROC_ACCESS],
.rpc_argp = &arg, .rpc_argp = &arg,
.rpc_resp = &res, .rpc_resp = &res,
.rpc_cred = entry->cred, .rpc_cred = cred,
}; };
int status = -ENOMEM; int status = -ENOMEM;
......
...@@ -46,7 +46,7 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep, ...@@ -46,7 +46,7 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
{ {
struct inode *inode = file_inode(filep); struct inode *inode = file_inode(filep);
struct nfs_server *server = NFS_SERVER(inode); struct nfs_server *server = NFS_SERVER(inode);
u32 bitmask[3]; u32 bitmask[NFS_BITMASK_SZ];
struct nfs42_falloc_args args = { struct nfs42_falloc_args args = {
.falloc_fh = NFS_FH(inode), .falloc_fh = NFS_FH(inode),
.falloc_offset = offset, .falloc_offset = offset,
...@@ -69,9 +69,8 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep, ...@@ -69,9 +69,8 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
return status; return status;
} }
memcpy(bitmask, server->cache_consistency_bitmask, sizeof(bitmask)); nfs4_bitmask_set(bitmask, server->cache_consistency_bitmask, inode,
if (server->attr_bitmask[1] & FATTR4_WORD1_SPACE_USED) NFS_INO_INVALID_BLOCKS);
bitmask[1] |= FATTR4_WORD1_SPACE_USED;
res.falloc_fattr = nfs_alloc_fattr(); res.falloc_fattr = nfs_alloc_fattr();
if (!res.falloc_fattr) if (!res.falloc_fattr)
...@@ -1044,13 +1043,14 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f, ...@@ -1044,13 +1043,14 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
struct inode *src_inode = file_inode(src_f); struct inode *src_inode = file_inode(src_f);
struct inode *dst_inode = file_inode(dst_f); struct inode *dst_inode = file_inode(dst_f);
struct nfs_server *server = NFS_SERVER(dst_inode); struct nfs_server *server = NFS_SERVER(dst_inode);
__u32 dst_bitmask[NFS_BITMASK_SZ];
struct nfs42_clone_args args = { struct nfs42_clone_args args = {
.src_fh = NFS_FH(src_inode), .src_fh = NFS_FH(src_inode),
.dst_fh = NFS_FH(dst_inode), .dst_fh = NFS_FH(dst_inode),
.src_offset = src_offset, .src_offset = src_offset,
.dst_offset = dst_offset, .dst_offset = dst_offset,
.count = count, .count = count,
.dst_bitmask = server->cache_consistency_bitmask, .dst_bitmask = dst_bitmask,
}; };
struct nfs42_clone_res res = { struct nfs42_clone_res res = {
.server = server, .server = server,
...@@ -1079,6 +1079,9 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f, ...@@ -1079,6 +1079,9 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
if (!res.dst_fattr) if (!res.dst_fattr)
return -ENOMEM; return -ENOMEM;
nfs4_bitmask_set(dst_bitmask, server->cache_consistency_bitmask,
dst_inode, NFS_INO_INVALID_BLOCKS);
status = nfs4_call_sync(server->client, server, msg, status = nfs4_call_sync(server->client, server, msg,
&args.seq_args, &res.seq_res, 0); &args.seq_args, &res.seq_res, 0);
trace_nfs4_clone(src_inode, dst_inode, &args, status); trace_nfs4_clone(src_inode, dst_inode, &args, status);
......
...@@ -260,8 +260,8 @@ struct nfs4_state_maintenance_ops { ...@@ -260,8 +260,8 @@ struct nfs4_state_maintenance_ops {
}; };
struct nfs4_mig_recovery_ops { struct nfs4_mig_recovery_ops {
int (*get_locations)(struct inode *, struct nfs4_fs_locations *, int (*get_locations)(struct nfs_server *, struct nfs_fh *,
struct page *, const struct cred *); struct nfs4_fs_locations *, struct page *, const struct cred *);
int (*fsid_present)(struct inode *, const struct cred *); int (*fsid_present)(struct inode *, const struct cred *);
}; };
...@@ -280,7 +280,8 @@ struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, ...@@ -280,7 +280,8 @@ struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *,
int nfs4_submount(struct fs_context *, struct nfs_server *); int nfs4_submount(struct fs_context *, struct nfs_server *);
int nfs4_replace_transport(struct nfs_server *server, int nfs4_replace_transport(struct nfs_server *server,
const struct nfs4_fs_locations *locations); const struct nfs4_fs_locations *locations);
size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa,
size_t salen, struct net *net, int port);
/* nfs4proc.c */ /* nfs4proc.c */
extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *); extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *);
extern int nfs4_async_handle_error(struct rpc_task *task, extern int nfs4_async_handle_error(struct rpc_task *task,
...@@ -302,8 +303,9 @@ extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait); ...@@ -302,8 +303,9 @@ extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait);
extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle);
extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *, extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *,
struct nfs4_fs_locations *, struct page *); struct nfs4_fs_locations *, struct page *);
extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *, extern int nfs4_proc_get_locations(struct nfs_server *, struct nfs_fh *,
struct page *page, const struct cred *); struct nfs4_fs_locations *,
struct page *page, const struct cred *);
extern int nfs4_proc_fsid_present(struct inode *, const struct cred *); extern int nfs4_proc_fsid_present(struct inode *, const struct cred *);
extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *,
struct dentry *, struct dentry *,
...@@ -315,6 +317,8 @@ extern int nfs4_set_rw_stateid(nfs4_stateid *stateid, ...@@ -315,6 +317,8 @@ extern int nfs4_set_rw_stateid(nfs4_stateid *stateid,
const struct nfs_open_context *ctx, const struct nfs_open_context *ctx,
const struct nfs_lock_context *l_ctx, const struct nfs_lock_context *l_ctx,
fmode_t fmode); fmode_t fmode);
extern void nfs4_bitmask_set(__u32 bitmask[], const __u32 src[],
struct inode *inode, unsigned long cache_validity);
extern int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, extern int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
struct nfs_fattr *fattr, struct inode *inode); struct nfs_fattr *fattr, struct inode *inode);
extern int update_open_stateid(struct nfs4_state *state, extern int update_open_stateid(struct nfs4_state *state,
......
...@@ -1343,8 +1343,11 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname, ...@@ -1343,8 +1343,11 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
} }
nfs_put_client(clp); nfs_put_client(clp);
if (server->nfs_client->cl_hostname == NULL) if (server->nfs_client->cl_hostname == NULL) {
server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL); server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL);
if (server->nfs_client->cl_hostname == NULL)
return -ENOMEM;
}
nfs_server_insert_lists(server); nfs_server_insert_lists(server);
return nfs_probe_server(server, NFS_FH(d_inode(server->super->s_root))); return nfs_probe_server(server, NFS_FH(d_inode(server->super->s_root)));
......
...@@ -164,16 +164,21 @@ static int nfs4_validate_fspath(struct dentry *dentry, ...@@ -164,16 +164,21 @@ static int nfs4_validate_fspath(struct dentry *dentry,
return 0; return 0;
} }
static size_t nfs_parse_server_name(char *string, size_t len, size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa,
struct sockaddr *sa, size_t salen, struct net *net) size_t salen, struct net *net, int port)
{ {
ssize_t ret; ssize_t ret;
ret = rpc_pton(net, string, len, sa, salen); ret = rpc_pton(net, string, len, sa, salen);
if (ret == 0) { if (ret == 0) {
ret = nfs_dns_resolve_name(net, string, len, sa, salen); ret = rpc_uaddr2sockaddr(net, string, len, sa, salen);
if (ret < 0) if (ret == 0) {
ret = 0; ret = nfs_dns_resolve_name(net, string, len, sa, salen);
if (ret < 0)
ret = 0;
}
} else if (port) {
rpc_set_port(sa, port);
} }
return ret; return ret;
} }
...@@ -328,7 +333,7 @@ static int try_location(struct fs_context *fc, ...@@ -328,7 +333,7 @@ static int try_location(struct fs_context *fc,
nfs_parse_server_name(buf->data, buf->len, nfs_parse_server_name(buf->data, buf->len,
&ctx->nfs_server.address, &ctx->nfs_server.address,
sizeof(ctx->nfs_server._address), sizeof(ctx->nfs_server._address),
fc->net_ns); fc->net_ns, 0);
if (ctx->nfs_server.addrlen == 0) if (ctx->nfs_server.addrlen == 0)
continue; continue;
...@@ -496,7 +501,7 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server, ...@@ -496,7 +501,7 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server,
continue; continue;
salen = nfs_parse_server_name(buf->data, buf->len, salen = nfs_parse_server_name(buf->data, buf->len,
sap, addr_bufsize, net); sap, addr_bufsize, net, 0);
if (salen == 0) if (salen == 0)
continue; continue;
rpc_set_port(sap, NFS_PORT); rpc_set_port(sap, NFS_PORT);
......
This diff is collapsed.
...@@ -2098,7 +2098,8 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred ...@@ -2098,7 +2098,8 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred
} }
inode = d_inode(server->super->s_root); inode = d_inode(server->super->s_root);
result = nfs4_proc_get_locations(inode, locations, page, cred); result = nfs4_proc_get_locations(server, NFS_FH(inode), locations,
page, cred);
if (result) { if (result) {
dprintk("<-- %s: failed to retrieve fs_locations: %d\n", dprintk("<-- %s: failed to retrieve fs_locations: %d\n",
__func__, result); __func__, result);
...@@ -2106,6 +2107,9 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred ...@@ -2106,6 +2107,9 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred
} }
result = -NFS4ERR_NXIO; result = -NFS4ERR_NXIO;
if (!locations->nlocations)
goto out;
if (!(locations->fattr.valid & NFS_ATTR_FATTR_V4_LOCATIONS)) { if (!(locations->fattr.valid & NFS_ATTR_FATTR_V4_LOCATIONS)) {
dprintk("<-- %s: No fs_locations data, migration skipped\n", dprintk("<-- %s: No fs_locations data, migration skipped\n",
__func__); __func__);
......
...@@ -3533,6 +3533,42 @@ static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint ...@@ -3533,6 +3533,42 @@ static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint
return 0; return 0;
} }
static int decode_attr_case_insensitive(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
{
__be32 *p;
*res = 0;
if (unlikely(bitmap[0] & (FATTR4_WORD0_CASE_INSENSITIVE - 1U)))
return -EIO;
if (likely(bitmap[0] & FATTR4_WORD0_CASE_INSENSITIVE)) {
p = xdr_inline_decode(xdr, 4);
if (unlikely(!p))
return -EIO;
*res = be32_to_cpup(p);
bitmap[0] &= ~FATTR4_WORD0_CASE_INSENSITIVE;
}
dprintk("%s: case_insensitive=%s\n", __func__, *res == 0 ? "false" : "true");
return 0;
}
static int decode_attr_case_preserving(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
{
__be32 *p;
*res = 0;
if (unlikely(bitmap[0] & (FATTR4_WORD0_CASE_PRESERVING - 1U)))
return -EIO;
if (likely(bitmap[0] & FATTR4_WORD0_CASE_PRESERVING)) {
p = xdr_inline_decode(xdr, 4);
if (unlikely(!p))
return -EIO;
*res = be32_to_cpup(p);
bitmap[0] &= ~FATTR4_WORD0_CASE_PRESERVING;
}
dprintk("%s: case_preserving=%s\n", __func__, *res == 0 ? "false" : "true");
return 0;
}
static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid) static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
{ {
__be32 *p; __be32 *p;
...@@ -3696,8 +3732,6 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st ...@@ -3696,8 +3732,6 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st
if (unlikely(!p)) if (unlikely(!p))
goto out_eio; goto out_eio;
n = be32_to_cpup(p); n = be32_to_cpup(p);
if (n <= 0)
goto out_eio;
for (res->nlocations = 0; res->nlocations < n; res->nlocations++) { for (res->nlocations = 0; res->nlocations < n; res->nlocations++) {
u32 m; u32 m;
struct nfs4_fs_location *loc; struct nfs4_fs_location *loc;
...@@ -4200,10 +4234,11 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap, ...@@ -4200,10 +4234,11 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
} else } else
printk(KERN_WARNING "%s: label too long (%u)!\n", printk(KERN_WARNING "%s: label too long (%u)!\n",
__func__, len); __func__, len);
if (label && label->label)
dprintk("%s: label=%.*s, len=%d, PI=%d, LFS=%d\n",
__func__, label->len, (char *)label->label,
label->len, label->pi, label->lfs);
} }
if (label && label->label)
dprintk("%s: label=%s, len=%d, PI=%d, LFS=%d\n", __func__,
(char *)label->label, label->len, label->pi, label->lfs);
return status; return status;
} }
...@@ -4412,6 +4447,10 @@ static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_re ...@@ -4412,6 +4447,10 @@ static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_re
goto xdr_error; goto xdr_error;
if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0) if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0)
goto xdr_error; goto xdr_error;
if ((status = decode_attr_case_insensitive(xdr, bitmap, &res->case_insensitive)) != 0)
goto xdr_error;
if ((status = decode_attr_case_preserving(xdr, bitmap, &res->case_preserving)) != 0)
goto xdr_error;
if ((status = decode_attr_exclcreat_supported(xdr, bitmap, if ((status = decode_attr_exclcreat_supported(xdr, bitmap,
res->exclcreat_bitmask)) != 0) res->exclcreat_bitmask)) != 0)
goto xdr_error; goto xdr_error;
......
...@@ -142,10 +142,11 @@ static struct attribute *nfs_netns_client_attrs[] = { ...@@ -142,10 +142,11 @@ static struct attribute *nfs_netns_client_attrs[] = {
&nfs_netns_client_id.attr, &nfs_netns_client_id.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(nfs_netns_client);
static struct kobj_type nfs_netns_client_type = { static struct kobj_type nfs_netns_client_type = {
.release = nfs_netns_client_release, .release = nfs_netns_client_release,
.default_attrs = nfs_netns_client_attrs, .default_groups = nfs_netns_client_groups,
.sysfs_ops = &kobj_sysfs_ops, .sysfs_ops = &kobj_sysfs_ops,
.namespace = nfs_netns_client_namespace, .namespace = nfs_netns_client_namespace,
}; };
......
...@@ -61,7 +61,9 @@ ...@@ -61,7 +61,9 @@
struct nfs_access_entry { struct nfs_access_entry {
struct rb_node rb_node; struct rb_node rb_node;
struct list_head lru; struct list_head lru;
const struct cred * cred; kuid_t fsuid;
kgid_t fsgid;
struct group_info *group_info;
__u32 mask; __u32 mask;
struct rcu_head rcu_head; struct rcu_head rcu_head;
}; };
...@@ -395,7 +397,7 @@ extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fa ...@@ -395,7 +397,7 @@ extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fa
extern int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fattr *fattr); extern int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fattr *fattr);
extern int nfs_getattr(struct user_namespace *, const struct path *, extern int nfs_getattr(struct user_namespace *, const struct path *,
struct kstat *, u32, unsigned int); struct kstat *, u32, unsigned int);
extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *); extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *, const struct cred *);
extern void nfs_access_set_mask(struct nfs_access_entry *, u32); extern void nfs_access_set_mask(struct nfs_access_entry *, u32);
extern int nfs_permission(struct user_namespace *, struct inode *, int); extern int nfs_permission(struct user_namespace *, struct inode *, int);
extern int nfs_open(struct inode *, struct file *); extern int nfs_open(struct inode *, struct file *);
...@@ -532,8 +534,8 @@ extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, ...@@ -532,8 +534,8 @@ extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,
struct nfs_fattr *fattr); struct nfs_fattr *fattr);
extern int nfs_may_open(struct inode *inode, const struct cred *cred, int openflags); extern int nfs_may_open(struct inode *inode, const struct cred *cred, int openflags);
extern void nfs_access_zap_cache(struct inode *inode); extern void nfs_access_zap_cache(struct inode *inode);
extern int nfs_access_get_cached(struct inode *inode, const struct cred *cred, struct nfs_access_entry *res, extern int nfs_access_get_cached(struct inode *inode, const struct cred *cred,
bool may_block); u32 *mask, bool may_block);
/* /*
* linux/fs/nfs/symlink.c * linux/fs/nfs/symlink.c
......
...@@ -266,6 +266,8 @@ struct nfs_server { ...@@ -266,6 +266,8 @@ struct nfs_server {
#define NFS_CAP_ACLS (1U << 3) #define NFS_CAP_ACLS (1U << 3)
#define NFS_CAP_ATOMIC_OPEN (1U << 4) #define NFS_CAP_ATOMIC_OPEN (1U << 4)
#define NFS_CAP_LGOPEN (1U << 5) #define NFS_CAP_LGOPEN (1U << 5)
#define NFS_CAP_CASE_INSENSITIVE (1U << 6)
#define NFS_CAP_CASE_PRESERVING (1U << 7)
#define NFS_CAP_POSIX_LOCK (1U << 14) #define NFS_CAP_POSIX_LOCK (1U << 14)
#define NFS_CAP_UIDGID_NOMAP (1U << 15) #define NFS_CAP_UIDGID_NOMAP (1U << 15)
#define NFS_CAP_STATEID_NFSV41 (1U << 16) #define NFS_CAP_STATEID_NFSV41 (1U << 16)
...@@ -282,5 +284,5 @@ struct nfs_server { ...@@ -282,5 +284,5 @@ struct nfs_server {
#define NFS_CAP_COPY_NOTIFY (1U << 27) #define NFS_CAP_COPY_NOTIFY (1U << 27)
#define NFS_CAP_XATTR (1U << 28) #define NFS_CAP_XATTR (1U << 28)
#define NFS_CAP_READ_PLUS (1U << 29) #define NFS_CAP_READ_PLUS (1U << 29)
#define NFS_CAP_FS_LOCATIONS (1U << 30)
#endif #endif
...@@ -1194,6 +1194,8 @@ struct nfs4_server_caps_res { ...@@ -1194,6 +1194,8 @@ struct nfs4_server_caps_res {
u32 has_links; u32 has_links;
u32 has_symlinks; u32 has_symlinks;
u32 fh_expire_type; u32 fh_expire_type;
u32 case_insensitive;
u32 case_preserving;
}; };
#define NFS4_PATHNAME_MAXCOMPONENTS 512 #define NFS4_PATHNAME_MAXCOMPONENTS 512
...@@ -1737,7 +1739,7 @@ struct nfs_rpc_ops { ...@@ -1737,7 +1739,7 @@ struct nfs_rpc_ops {
struct nfs_fh *, struct nfs_fattr *); struct nfs_fh *, struct nfs_fattr *);
int (*lookupp) (struct inode *, struct nfs_fh *, int (*lookupp) (struct inode *, struct nfs_fh *,
struct nfs_fattr *); struct nfs_fattr *);
int (*access) (struct inode *, struct nfs_access_entry *); int (*access) (struct inode *, struct nfs_access_entry *, const struct cred *);
int (*readlink)(struct inode *, struct page *, unsigned int, int (*readlink)(struct inode *, struct page *, unsigned int,
unsigned int); unsigned int);
int (*create) (struct inode *, struct dentry *, int (*create) (struct inode *, struct dentry *,
...@@ -1795,6 +1797,7 @@ struct nfs_rpc_ops { ...@@ -1795,6 +1797,7 @@ struct nfs_rpc_ops {
struct nfs_server *(*create_server)(struct fs_context *); struct nfs_server *(*create_server)(struct fs_context *);
struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *, struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
struct nfs_fattr *, rpc_authflavor_t); struct nfs_fattr *, rpc_authflavor_t);
int (*discover_trunking)(struct nfs_server *, struct nfs_fh *);
}; };
/* /*
......
...@@ -794,6 +794,9 @@ RPC_SHOW_SOCKET ...@@ -794,6 +794,9 @@ RPC_SHOW_SOCKET
RPC_SHOW_SOCK RPC_SHOW_SOCK
#include <trace/events/net_probe_common.h>
/* /*
* Now redefine the EM() and EMe() macros to map the enums to the strings * Now redefine the EM() and EMe() macros to map the enums to the strings
* that will be printed in the output. * that will be printed in the output.
...@@ -816,27 +819,32 @@ DECLARE_EVENT_CLASS(xs_socket_event, ...@@ -816,27 +819,32 @@ DECLARE_EVENT_CLASS(xs_socket_event,
__field(unsigned int, socket_state) __field(unsigned int, socket_state)
__field(unsigned int, sock_state) __field(unsigned int, sock_state)
__field(unsigned long long, ino) __field(unsigned long long, ino)
__string(dstaddr, __array(__u8, saddr, sizeof(struct sockaddr_in6))
xprt->address_strings[RPC_DISPLAY_ADDR]) __array(__u8, daddr, sizeof(struct sockaddr_in6))
__string(dstport,
xprt->address_strings[RPC_DISPLAY_PORT])
), ),
TP_fast_assign( TP_fast_assign(
struct inode *inode = SOCK_INODE(socket); struct inode *inode = SOCK_INODE(socket);
const struct sock *sk = socket->sk;
const struct inet_sock *inet = inet_sk(sk);
memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
TP_STORE_ADDR_PORTS(__entry, inet, sk);
__entry->socket_state = socket->state; __entry->socket_state = socket->state;
__entry->sock_state = socket->sk->sk_state; __entry->sock_state = socket->sk->sk_state;
__entry->ino = (unsigned long long)inode->i_ino; __entry->ino = (unsigned long long)inode->i_ino;
__assign_str(dstaddr,
xprt->address_strings[RPC_DISPLAY_ADDR]);
__assign_str(dstport,
xprt->address_strings[RPC_DISPLAY_PORT]);
), ),
TP_printk( TP_printk(
"socket:[%llu] dstaddr=%s/%s " "socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc "
"state=%u (%s) sk_state=%u (%s)", "state=%u (%s) sk_state=%u (%s)",
__entry->ino, __get_str(dstaddr), __get_str(dstport), __entry->ino,
__entry->saddr,
__entry->daddr,
__entry->socket_state, __entry->socket_state,
rpc_show_socket_state(__entry->socket_state), rpc_show_socket_state(__entry->socket_state),
__entry->sock_state, __entry->sock_state,
...@@ -866,29 +874,33 @@ DECLARE_EVENT_CLASS(xs_socket_event_done, ...@@ -866,29 +874,33 @@ DECLARE_EVENT_CLASS(xs_socket_event_done,
__field(unsigned int, socket_state) __field(unsigned int, socket_state)
__field(unsigned int, sock_state) __field(unsigned int, sock_state)
__field(unsigned long long, ino) __field(unsigned long long, ino)
__string(dstaddr, __array(__u8, saddr, sizeof(struct sockaddr_in6))
xprt->address_strings[RPC_DISPLAY_ADDR]) __array(__u8, daddr, sizeof(struct sockaddr_in6))
__string(dstport,
xprt->address_strings[RPC_DISPLAY_PORT])
), ),
TP_fast_assign( TP_fast_assign(
struct inode *inode = SOCK_INODE(socket); struct inode *inode = SOCK_INODE(socket);
const struct sock *sk = socket->sk;
const struct inet_sock *inet = inet_sk(sk);
memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
TP_STORE_ADDR_PORTS(__entry, inet, sk);
__entry->socket_state = socket->state; __entry->socket_state = socket->state;
__entry->sock_state = socket->sk->sk_state; __entry->sock_state = socket->sk->sk_state;
__entry->ino = (unsigned long long)inode->i_ino; __entry->ino = (unsigned long long)inode->i_ino;
__entry->error = error; __entry->error = error;
__assign_str(dstaddr,
xprt->address_strings[RPC_DISPLAY_ADDR]);
__assign_str(dstport,
xprt->address_strings[RPC_DISPLAY_PORT]);
), ),
TP_printk( TP_printk(
"error=%d socket:[%llu] dstaddr=%s/%s " "error=%d socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc "
"state=%u (%s) sk_state=%u (%s)", "state=%u (%s) sk_state=%u (%s)",
__entry->error, __entry->error,
__entry->ino, __get_str(dstaddr), __get_str(dstport), __entry->ino,
__entry->saddr,
__entry->daddr,
__entry->socket_state, __entry->socket_state,
rpc_show_socket_state(__entry->socket_state), rpc_show_socket_state(__entry->socket_state),
__entry->sock_state, __entry->sock_state,
...@@ -953,7 +965,8 @@ TRACE_EVENT(rpc_socket_nospace, ...@@ -953,7 +965,8 @@ TRACE_EVENT(rpc_socket_nospace,
{ BIT(XPRT_REMOVE), "REMOVE" }, \ { BIT(XPRT_REMOVE), "REMOVE" }, \
{ BIT(XPRT_CONGESTED), "CONGESTED" }, \ { BIT(XPRT_CONGESTED), "CONGESTED" }, \
{ BIT(XPRT_CWND_WAIT), "CWND_WAIT" }, \ { BIT(XPRT_CWND_WAIT), "CWND_WAIT" }, \
{ BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" }) { BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" }, \
{ BIT(XPRT_SND_IS_COOKIE), "SND_IS_COOKIE" })
DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class, DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class,
TP_PROTO( TP_PROTO(
...@@ -1150,8 +1163,11 @@ DECLARE_EVENT_CLASS(xprt_writelock_event, ...@@ -1150,8 +1163,11 @@ DECLARE_EVENT_CLASS(xprt_writelock_event,
__entry->task_id = -1; __entry->task_id = -1;
__entry->client_id = -1; __entry->client_id = -1;
} }
__entry->snd_task_id = xprt->snd_task ? if (xprt->snd_task &&
xprt->snd_task->tk_pid : -1; !test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
__entry->snd_task_id = xprt->snd_task->tk_pid;
else
__entry->snd_task_id = -1;
), ),
TP_printk(SUNRPC_TRACE_TASK_SPECIFIER TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
...@@ -1196,8 +1212,12 @@ DECLARE_EVENT_CLASS(xprt_cong_event, ...@@ -1196,8 +1212,12 @@ DECLARE_EVENT_CLASS(xprt_cong_event,
__entry->task_id = -1; __entry->task_id = -1;
__entry->client_id = -1; __entry->client_id = -1;
} }
__entry->snd_task_id = xprt->snd_task ? if (xprt->snd_task &&
xprt->snd_task->tk_pid : -1; !test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
__entry->snd_task_id = xprt->snd_task->tk_pid;
else
__entry->snd_task_id = -1;
__entry->cong = xprt->cong; __entry->cong = xprt->cong;
__entry->cwnd = xprt->cwnd; __entry->cwnd = xprt->cwnd;
__entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state); __entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state);
......
...@@ -222,10 +222,8 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size, ...@@ -222,10 +222,8 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
if (ret) if (ret)
return ret; return ret;
if (!ret) { *buf_in = buf;
*buf_in = buf; *body_size = toksize;
*body_size = toksize;
}
return ret; return ret;
} }
......
...@@ -2900,7 +2900,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt, ...@@ -2900,7 +2900,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
unsigned long connect_timeout; unsigned long connect_timeout;
unsigned long reconnect_timeout; unsigned long reconnect_timeout;
unsigned char resvport, reuseport; unsigned char resvport, reuseport;
int ret = 0; int ret = 0, ident;
rcu_read_lock(); rcu_read_lock();
xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch)); xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch));
...@@ -2914,8 +2914,11 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt, ...@@ -2914,8 +2914,11 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
reuseport = xprt->reuseport; reuseport = xprt->reuseport;
connect_timeout = xprt->connect_timeout; connect_timeout = xprt->connect_timeout;
reconnect_timeout = xprt->max_reconnect_timeout; reconnect_timeout = xprt->max_reconnect_timeout;
ident = xprt->xprt_class->ident;
rcu_read_unlock(); rcu_read_unlock();
if (!xprtargs->ident)
xprtargs->ident = ident;
xprt = xprt_create_transport(xprtargs); xprt = xprt_create_transport(xprtargs);
if (IS_ERR(xprt)) { if (IS_ERR(xprt)) {
ret = PTR_ERR(xprt); ret = PTR_ERR(xprt);
......
...@@ -295,8 +295,10 @@ static ssize_t rpc_sysfs_xprt_state_change(struct kobject *kobj, ...@@ -295,8 +295,10 @@ static ssize_t rpc_sysfs_xprt_state_change(struct kobject *kobj,
online = 1; online = 1;
else if (!strncmp(buf, "remove", 6)) else if (!strncmp(buf, "remove", 6))
remove = 1; remove = 1;
else else {
return -EINVAL; count = -EINVAL;
goto out_put;
}
if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) { if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) {
count = -EINTR; count = -EINTR;
...@@ -307,25 +309,28 @@ static ssize_t rpc_sysfs_xprt_state_change(struct kobject *kobj, ...@@ -307,25 +309,28 @@ static ssize_t rpc_sysfs_xprt_state_change(struct kobject *kobj,
goto release_tasks; goto release_tasks;
} }
if (offline) { if (offline) {
set_bit(XPRT_OFFLINE, &xprt->state); if (!test_and_set_bit(XPRT_OFFLINE, &xprt->state)) {
spin_lock(&xps->xps_lock); spin_lock(&xps->xps_lock);
xps->xps_nactive--; xps->xps_nactive--;
spin_unlock(&xps->xps_lock); spin_unlock(&xps->xps_lock);
}
} else if (online) { } else if (online) {
clear_bit(XPRT_OFFLINE, &xprt->state); if (test_and_clear_bit(XPRT_OFFLINE, &xprt->state)) {
spin_lock(&xps->xps_lock); spin_lock(&xps->xps_lock);
xps->xps_nactive++; xps->xps_nactive++;
spin_unlock(&xps->xps_lock); spin_unlock(&xps->xps_lock);
}
} else if (remove) { } else if (remove) {
if (test_bit(XPRT_OFFLINE, &xprt->state)) { if (test_bit(XPRT_OFFLINE, &xprt->state)) {
set_bit(XPRT_REMOVE, &xprt->state); if (!test_and_set_bit(XPRT_REMOVE, &xprt->state)) {
xprt_force_disconnect(xprt); xprt_force_disconnect(xprt);
if (test_bit(XPRT_CONNECTED, &xprt->state)) { if (test_bit(XPRT_CONNECTED, &xprt->state)) {
if (!xprt->sending.qlen && if (!xprt->sending.qlen &&
!xprt->pending.qlen && !xprt->pending.qlen &&
!xprt->backlog.qlen && !xprt->backlog.qlen &&
!atomic_long_read(&xprt->queuelen)) !atomic_long_read(&xprt->queuelen))
rpc_xprt_switch_remove_xprt(xps, xprt); rpc_xprt_switch_remove_xprt(xps, xprt);
}
} }
} else { } else {
count = -EINVAL; count = -EINVAL;
...@@ -422,6 +427,7 @@ static struct attribute *rpc_sysfs_xprt_attrs[] = { ...@@ -422,6 +427,7 @@ static struct attribute *rpc_sysfs_xprt_attrs[] = {
&rpc_sysfs_xprt_change_state.attr, &rpc_sysfs_xprt_change_state.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(rpc_sysfs_xprt);
static struct kobj_attribute rpc_sysfs_xprt_switch_info = static struct kobj_attribute rpc_sysfs_xprt_switch_info =
__ATTR(xprt_switch_info, 0444, rpc_sysfs_xprt_switch_info_show, NULL); __ATTR(xprt_switch_info, 0444, rpc_sysfs_xprt_switch_info_show, NULL);
...@@ -430,6 +436,7 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = { ...@@ -430,6 +436,7 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = {
&rpc_sysfs_xprt_switch_info.attr, &rpc_sysfs_xprt_switch_info.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(rpc_sysfs_xprt_switch);
static struct kobj_type rpc_sysfs_client_type = { static struct kobj_type rpc_sysfs_client_type = {
.release = rpc_sysfs_client_release, .release = rpc_sysfs_client_release,
...@@ -439,14 +446,14 @@ static struct kobj_type rpc_sysfs_client_type = { ...@@ -439,14 +446,14 @@ static struct kobj_type rpc_sysfs_client_type = {
static struct kobj_type rpc_sysfs_xprt_switch_type = { static struct kobj_type rpc_sysfs_xprt_switch_type = {
.release = rpc_sysfs_xprt_switch_release, .release = rpc_sysfs_xprt_switch_release,
.default_attrs = rpc_sysfs_xprt_switch_attrs, .default_groups = rpc_sysfs_xprt_switch_groups,
.sysfs_ops = &kobj_sysfs_ops, .sysfs_ops = &kobj_sysfs_ops,
.namespace = rpc_sysfs_xprt_switch_namespace, .namespace = rpc_sysfs_xprt_switch_namespace,
}; };
static struct kobj_type rpc_sysfs_xprt_type = { static struct kobj_type rpc_sysfs_xprt_type = {
.release = rpc_sysfs_xprt_release, .release = rpc_sysfs_xprt_release,
.default_attrs = rpc_sysfs_xprt_attrs, .default_groups = rpc_sysfs_xprt_groups,
.sysfs_ops = &kobj_sysfs_ops, .sysfs_ops = &kobj_sysfs_ops,
.namespace = rpc_sysfs_xprt_namespace, .namespace = rpc_sysfs_xprt_namespace,
}; };
......
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
#include "xprt_rdma.h" #include "xprt_rdma.h"
#include <trace/events/rpcrdma.h> #include <trace/events/rpcrdma.h>
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
# define RPCDBG_FACILITY RPCDBG_TRANS
#endif
#undef RPCRDMA_BACKCHANNEL_DEBUG #undef RPCRDMA_BACKCHANNEL_DEBUG
/** /**
......
...@@ -45,10 +45,6 @@ ...@@ -45,10 +45,6 @@
#include "xprt_rdma.h" #include "xprt_rdma.h"
#include <trace/events/rpcrdma.h> #include <trace/events/rpcrdma.h>
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
# define RPCDBG_FACILITY RPCDBG_TRANS
#endif
static void frwr_cid_init(struct rpcrdma_ep *ep, static void frwr_cid_init(struct rpcrdma_ep *ep,
struct rpcrdma_mr *mr) struct rpcrdma_mr *mr)
{ {
......
...@@ -54,10 +54,6 @@ ...@@ -54,10 +54,6 @@
#include "xprt_rdma.h" #include "xprt_rdma.h"
#include <trace/events/rpcrdma.h> #include <trace/events/rpcrdma.h>
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
# define RPCDBG_FACILITY RPCDBG_TRANS
#endif
/* Returns size of largest RPC-over-RDMA header in a Call message /* Returns size of largest RPC-over-RDMA header in a Call message
* *
* The largest Call header contains a full-size Read list and a * The largest Call header contains a full-size Read list and a
......
...@@ -60,10 +60,6 @@ ...@@ -60,10 +60,6 @@
#include "xprt_rdma.h" #include "xprt_rdma.h"
#include <trace/events/rpcrdma.h> #include <trace/events/rpcrdma.h>
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
# define RPCDBG_FACILITY RPCDBG_TRANS
#endif
/* /*
* tunables * tunables
*/ */
......
...@@ -63,17 +63,6 @@ ...@@ -63,17 +63,6 @@
#include "xprt_rdma.h" #include "xprt_rdma.h"
#include <trace/events/rpcrdma.h> #include <trace/events/rpcrdma.h>
/*
* Globals/Macros
*/
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
# define RPCDBG_FACILITY RPCDBG_TRANS
#endif
/*
* internal functions
*/
static int rpcrdma_sendctxs_create(struct rpcrdma_xprt *r_xprt); static int rpcrdma_sendctxs_create(struct rpcrdma_xprt *r_xprt);
static void rpcrdma_sendctxs_destroy(struct rpcrdma_xprt *r_xprt); static void rpcrdma_sendctxs_destroy(struct rpcrdma_xprt *r_xprt);
static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt, static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt,
...@@ -274,8 +263,6 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) ...@@ -274,8 +263,6 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
ep->re_connect_status = -ENETUNREACH; ep->re_connect_status = -ENETUNREACH;
goto wake_connect_worker; goto wake_connect_worker;
case RDMA_CM_EVENT_REJECTED: case RDMA_CM_EVENT_REJECTED:
dprintk("rpcrdma: connection to %pISpc rejected: %s\n",
sap, rdma_reject_msg(id, event->status));
ep->re_connect_status = -ECONNREFUSED; ep->re_connect_status = -ECONNREFUSED;
if (event->status == IB_CM_REJ_STALE_CONN) if (event->status == IB_CM_REJ_STALE_CONN)
ep->re_connect_status = -ENOTCONN; ep->re_connect_status = -ENOTCONN;
...@@ -291,8 +278,6 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) ...@@ -291,8 +278,6 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
break; break;
} }
dprintk("RPC: %s: %pISpc on %s/frwr: %s\n", __func__, sap,
ep->re_id->device->name, rdma_event_msg(event->event));
return 0; return 0;
} }
...@@ -419,14 +404,6 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt) ...@@ -419,14 +404,6 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)
ep->re_attr.qp_type = IB_QPT_RC; ep->re_attr.qp_type = IB_QPT_RC;
ep->re_attr.port_num = ~0; ep->re_attr.port_num = ~0;
dprintk("RPC: %s: requested max: dtos: send %d recv %d; "
"iovs: send %d recv %d\n",
__func__,
ep->re_attr.cap.max_send_wr,
ep->re_attr.cap.max_recv_wr,
ep->re_attr.cap.max_send_sge,
ep->re_attr.cap.max_recv_sge);
ep->re_send_batch = ep->re_max_requests >> 3; ep->re_send_batch = ep->re_max_requests >> 3;
ep->re_send_count = ep->re_send_batch; ep->re_send_count = ep->re_send_batch;
init_waitqueue_head(&ep->re_connect_wait); init_waitqueue_head(&ep->re_connect_wait);
......
...@@ -1910,7 +1910,7 @@ static void xs_local_connect(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -1910,7 +1910,7 @@ static void xs_local_connect(struct rpc_xprt *xprt, struct rpc_task *task)
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
int ret; int ret;
if (RPC_IS_ASYNC(task)) { if (RPC_IS_ASYNC(task)) {
/* /*
* We want the AF_LOCAL connect to be resolved in the * We want the AF_LOCAL connect to be resolved in the
* filesystem namespace of the process making the rpc * filesystem namespace of the process making the rpc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment