Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346620
b: refs/heads/master
c: 7ce0171
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 11, 2012
1 parent 8a074ed commit 9e49eec
Show file tree
Hide file tree
Showing 47 changed files with 1,206 additions and 1,027 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81d9bce5309288086b58b4d97a644e495fef75f2
refs/heads/master: 7ce0171d4f78992184faed87ea897d730b972965
8 changes: 0 additions & 8 deletions trunk/fs/lockd/clnt4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ static void nlm4_compute_offsets(const struct nlm_lock *lock,
{
const struct file_lock *fl = &lock->fl;

BUG_ON(fl->fl_start > NLM4_OFFSET_MAX);
BUG_ON(fl->fl_end > NLM4_OFFSET_MAX &&
fl->fl_end != OFFSET_MAX);

*l_offset = loff_t_to_s64(fl->fl_start);
if (fl->fl_end == OFFSET_MAX)
*l_len = 0;
Expand Down Expand Up @@ -122,7 +118,6 @@ static void encode_netobj(struct xdr_stream *xdr,
{
__be32 *p;

BUG_ON(length > XDR_MAX_NETOBJ);
p = xdr_reserve_space(xdr, 4 + length);
xdr_encode_opaque(p, data, length);
}
Expand Down Expand Up @@ -156,7 +151,6 @@ static int decode_netobj(struct xdr_stream *xdr,
static void encode_cookie(struct xdr_stream *xdr,
const struct nlm_cookie *cookie)
{
BUG_ON(cookie->len > NLM_MAXCOOKIELEN);
encode_netobj(xdr, (u8 *)&cookie->data, cookie->len);
}

Expand Down Expand Up @@ -198,7 +192,6 @@ static int decode_cookie(struct xdr_stream *xdr,
*/
static void encode_fh(struct xdr_stream *xdr, const struct nfs_fh *fh)
{
BUG_ON(fh->size > NFS3_FHSIZE);
encode_netobj(xdr, (u8 *)&fh->data, fh->size);
}

Expand Down Expand Up @@ -336,7 +329,6 @@ static void encode_caller_name(struct xdr_stream *xdr, const char *name)
u32 length = strlen(name);
__be32 *p;

BUG_ON(length > NLM_MAXSTRLEN);
p = xdr_reserve_space(xdr, 4 + length);
xdr_encode_opaque(p, name, length);
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/lockd/clntproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)

static void nlmclnt_release_lockargs(struct nlm_rqst *req)
{
BUG_ON(req->a_args.lock.fl.fl_ops != NULL);
WARN_ON_ONCE(req->a_args.lock.fl.fl_ops != NULL);
}

/**
Expand Down Expand Up @@ -465,7 +465,6 @@ static const struct file_lock_operations nlmclnt_lock_ops = {

static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host)
{
BUG_ON(fl->fl_ops != NULL);
fl->fl_u.nfs_fl.state = 0;
fl->fl_u.nfs_fl.owner = nlm_find_lockowner(host, fl->fl_owner);
INIT_LIST_HEAD(&fl->fl_u.nfs_fl.list);
Expand Down
8 changes: 0 additions & 8 deletions trunk/fs/lockd/clntxdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ static void nlm_compute_offsets(const struct nlm_lock *lock,
{
const struct file_lock *fl = &lock->fl;

BUG_ON(fl->fl_start > NLM_OFFSET_MAX);
BUG_ON(fl->fl_end > NLM_OFFSET_MAX &&
fl->fl_end != OFFSET_MAX);

*l_offset = loff_t_to_s32(fl->fl_start);
if (fl->fl_end == OFFSET_MAX)
*l_len = 0;
Expand Down Expand Up @@ -119,7 +115,6 @@ static void encode_netobj(struct xdr_stream *xdr,
{
__be32 *p;

BUG_ON(length > XDR_MAX_NETOBJ);
p = xdr_reserve_space(xdr, 4 + length);
xdr_encode_opaque(p, data, length);
}
Expand Down Expand Up @@ -153,7 +148,6 @@ static int decode_netobj(struct xdr_stream *xdr,
static void encode_cookie(struct xdr_stream *xdr,
const struct nlm_cookie *cookie)
{
BUG_ON(cookie->len > NLM_MAXCOOKIELEN);
encode_netobj(xdr, (u8 *)&cookie->data, cookie->len);
}

Expand Down Expand Up @@ -195,7 +189,6 @@ static int decode_cookie(struct xdr_stream *xdr,
*/
static void encode_fh(struct xdr_stream *xdr, const struct nfs_fh *fh)
{
BUG_ON(fh->size != NFS2_FHSIZE);
encode_netobj(xdr, (u8 *)&fh->data, NFS2_FHSIZE);
}

Expand Down Expand Up @@ -330,7 +323,6 @@ static void encode_caller_name(struct xdr_stream *xdr, const char *name)
u32 length = strlen(name);
__be32 *p;

BUG_ON(length > NLM_MAXSTRLEN);
p = xdr_reserve_space(xdr, 4 + length);
xdr_encode_opaque(p, name, length);
}
Expand Down
15 changes: 5 additions & 10 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ static void nlm_destroy_host_locked(struct nlm_host *host)

dprintk("lockd: destroy host %s\n", host->h_name);

BUG_ON(!list_empty(&host->h_lockowners));
BUG_ON(atomic_read(&host->h_count));

hlist_del_init(&host->h_hash);

nsm_unmonitor(host);
Expand Down Expand Up @@ -289,13 +286,12 @@ void nlmclnt_release_host(struct nlm_host *host)

dprintk("lockd: release client host %s\n", host->h_name);

BUG_ON(atomic_read(&host->h_count) < 0);
BUG_ON(host->h_server);
WARN_ON_ONCE(host->h_server);

if (atomic_dec_and_test(&host->h_count)) {
BUG_ON(!list_empty(&host->h_lockowners));
BUG_ON(!list_empty(&host->h_granted));
BUG_ON(!list_empty(&host->h_reclaim));
WARN_ON_ONCE(!list_empty(&host->h_lockowners));
WARN_ON_ONCE(!list_empty(&host->h_granted));
WARN_ON_ONCE(!list_empty(&host->h_reclaim));

mutex_lock(&nlm_host_mutex);
nlm_destroy_host_locked(host);
Expand Down Expand Up @@ -412,8 +408,7 @@ void nlmsvc_release_host(struct nlm_host *host)

dprintk("lockd: release server host %s\n", host->h_name);

BUG_ON(atomic_read(&host->h_count) < 0);
BUG_ON(!host->h_server);
WARN_ON_ONCE(!host->h_server);
atomic_dec(&host->h_count);
}

Expand Down
3 changes: 0 additions & 3 deletions trunk/fs/lockd/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ static int nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res,
.rpc_resp = res,
};

BUG_ON(clnt == NULL);

memset(res, 0, sizeof(*res));

msg.rpc_proc = &clnt->cl_procinfo[proc];
Expand Down Expand Up @@ -466,7 +464,6 @@ static void encode_nsm_string(struct xdr_stream *xdr, const char *string)
const u32 len = strlen(string);
__be32 *p;

BUG_ON(len > SM_MAXSTRLEN);
p = xdr_reserve_space(xdr, 4 + len);
xdr_encode_opaque(p, string, len);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/nfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nfsv4-y := nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o nfs4super.o nfs4file.o
delegation.o idmap.o callback.o callback_xdr.o callback_proc.o \
nfs4namespace.o nfs4getroot.o nfs4client.o
nfsv4-$(CONFIG_SYSCTL) += nfs4sysctl.o
nfsv4-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o
nfsv4-$(CONFIG_NFS_V4_1) += nfs4session.o pnfs.o pnfs_dev.o

obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o
nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/nfs/blocklayout/blocklayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <linux/pagevec.h>

#include "../pnfs.h"
#include "../nfs4session.h"
#include "../internal.h"
#include "blocklayout.h"

Expand Down
1 change: 0 additions & 1 deletion trunk/fs/nfs/cache_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ int nfs_cache_register_sb(struct super_block *sb, struct cache_detail *cd)
struct dentry *dir;

dir = rpc_d_lookup_sb(sb, "cache");
BUG_ON(dir == NULL);
ret = sunrpc_cache_register_pipefs(dir, cd->name, 0600, cd);
dput(dir);
return ret;
Expand Down
4 changes: 1 addition & 3 deletions trunk/fs/nfs/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ extern __be32 nfs4_callback_recallany(struct cb_recallanyargs *args,

struct cb_recallslotargs {
struct sockaddr *crsa_addr;
uint32_t crsa_target_max_slots;
uint32_t crsa_target_highest_slotid;
};
extern __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args,
void *dummy,
Expand All @@ -167,8 +167,6 @@ extern __be32 nfs4_callback_layoutrecall(
struct cb_layoutrecallargs *args,
void *dummy, struct cb_process_state *cps);

extern void nfs4_check_drain_bc_complete(struct nfs4_session *ses);

struct cb_devicenotifyitem {
uint32_t cbd_notify_type;
uint32_t cbd_layout_type;
Expand Down
17 changes: 5 additions & 12 deletions trunk/fs/nfs/callback_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "delegation.h"
#include "internal.h"
#include "pnfs.h"
#include "nfs4session.h"

#ifdef NFS_DEBUG
#define NFSDBG_FACILITY NFSDBG_CALLBACK
Expand Down Expand Up @@ -216,7 +217,6 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
}
pnfs_get_layout_hdr(lo);
spin_unlock(&ino->i_lock);
BUG_ON(!list_empty(&lo->plh_bulk_recall));
list_add(&lo->plh_bulk_recall, &recall_list);
}
}
Expand Down Expand Up @@ -562,23 +562,16 @@ __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy,
if (!cps->clp) /* set in cb_sequence */
goto out;

dprintk_rcu("NFS: CB_RECALL_SLOT request from %s target max slots %d\n",
dprintk_rcu("NFS: CB_RECALL_SLOT request from %s target highest slotid %d\n",
rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR),
args->crsa_target_max_slots);
args->crsa_target_highest_slotid);

fc_tbl = &cps->clp->cl_session->fc_slot_table;

status = htonl(NFS4ERR_BAD_HIGH_SLOT);
if (args->crsa_target_max_slots > fc_tbl->max_slots ||
args->crsa_target_max_slots < 1)
goto out;

status = htonl(NFS4_OK);
if (args->crsa_target_max_slots == fc_tbl->max_slots)
goto out;

fc_tbl->target_max_slots = args->crsa_target_max_slots;
nfs41_handle_recall_slot(cps->clp);
nfs41_set_target_slotid(fc_tbl, args->crsa_target_highest_slotid);
nfs41_server_notify_target_slotid_update(cps->clp);
out:
dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
return status;
Expand Down
5 changes: 3 additions & 2 deletions trunk/fs/nfs/callback_xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "nfs4_fs.h"
#include "callback.h"
#include "internal.h"
#include "nfs4session.h"

#define CB_OP_TAGLEN_MAXSZ (512)
#define CB_OP_HDR_RES_MAXSZ (2 + CB_OP_TAGLEN_MAXSZ)
Expand Down Expand Up @@ -520,7 +521,7 @@ static __be32 decode_recallslot_args(struct svc_rqst *rqstp,
p = read_buf(xdr, 4);
if (unlikely(p == NULL))
return htonl(NFS4ERR_BADXDR);
args->crsa_target_max_slots = ntohl(*p++);
args->crsa_target_highest_slotid = ntohl(*p++);
return 0;
}

Expand Down Expand Up @@ -762,7 +763,7 @@ static void nfs4_callback_free_slot(struct nfs4_session *session)
* A single slot, so highest used slotid is either 0 or -1
*/
tbl->highest_used_slotid = NFS4_NO_SLOT;
nfs4_check_drain_bc_complete(session);
nfs4_session_drain_complete(session, tbl);
spin_unlock(&tbl->slot_tbl_lock);
}

Expand Down
6 changes: 1 addition & 5 deletions trunk/fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void nfs_put_client(struct nfs_client *clp)
nfs_cb_idr_remove_locked(clp);
spin_unlock(&nn->nfs_client_lock);

BUG_ON(!list_empty(&clp->cl_superblocks));
WARN_ON_ONCE(!list_empty(&clp->cl_superblocks));

clp->rpc_ops->free_client(clp);
}
Expand Down Expand Up @@ -1061,10 +1061,6 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info,
if (error < 0)
goto error;

BUG_ON(!server->nfs_client);
BUG_ON(!server->nfs_client->rpc_ops);
BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);

/* Probe the root fh to retrieve its FSID */
error = nfs_probe_fsinfo(server, mount_info->mntfh, fattr);
if (error < 0)
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ void nfs_clear_inode(struct inode *inode)
/*
* The following should never happen...
*/
BUG_ON(nfs_have_writebacks(inode));
BUG_ON(!list_empty(&NFS_I(inode)->open_files));
WARN_ON_ONCE(nfs_have_writebacks(inode));
WARN_ON_ONCE(!list_empty(&NFS_I(inode)->open_files));
nfs_zap_acl_cache(inode);
nfs_access_zap_cache(inode);
nfs_fscache_release_inode_cookie(inode);
Expand Down
35 changes: 0 additions & 35 deletions trunk/fs/nfs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,6 @@ struct nfs_string;
*/
#define NFS_MAX_READAHEAD (RPC_DEF_SLOT_TABLE - 1)

/*
* Determine if sessions are in use.
*/
static inline int nfs4_has_session(const struct nfs_client *clp)
{
#ifdef CONFIG_NFS_V4_1
if (clp->cl_session)
return 1;
#endif /* CONFIG_NFS_V4_1 */
return 0;
}

static inline int nfs4_has_persistent_session(const struct nfs_client *clp)
{
#ifdef CONFIG_NFS_V4_1
if (nfs4_has_session(clp))
return (clp->cl_session->flags & SESSION4_PERSIST);
#endif /* CONFIG_NFS_V4_1 */
return 0;
}

static inline void nfs_attr_check_mountpoint(struct super_block *parent, struct nfs_fattr *fattr)
{
if (!nfs_fsid_equal(&NFS_SB(parent)->fsid, &fattr->fsid))
Expand Down Expand Up @@ -276,8 +255,6 @@ extern const u32 nfs41_maxwrite_overhead;
extern struct rpc_procinfo nfs4_procedures[];
#endif

extern int nfs4_init_ds_session(struct nfs_client *, unsigned long);

/* proc.c */
void nfs_close_context(struct nfs_open_context *ctx, int is_sync);
extern struct nfs_client *nfs_init_client(struct nfs_client *clp,
Expand Down Expand Up @@ -474,18 +451,6 @@ extern struct nfs_client *nfs4_init_client(struct nfs_client *clp,
const struct rpc_timeout *timeparms,
const char *ip_addr,
rpc_authflavor_t authflavour);
extern int _nfs4_call_sync(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg,
struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res,
int cache_reply);
extern int _nfs4_call_sync_session(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg,
struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res,
int cache_reply);
extern int nfs40_walk_client_list(struct nfs_client *clp,
struct nfs_client **result,
struct rpc_cred *cred);
Expand Down
7 changes: 6 additions & 1 deletion trunk/fs/nfs/mount_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ int nfs_mount(struct nfs_mount_request *info)
(info->hostname ? info->hostname : "server"),
info->dirpath);

if (strlen(info->dirpath) > MNTPATHLEN)
return -ENAMETOOLONG;

if (info->noresvport)
args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;

Expand Down Expand Up @@ -242,6 +245,9 @@ void nfs_umount(const struct nfs_mount_request *info)
struct rpc_clnt *clnt;
int status;

if (strlen(info->dirpath) > MNTPATHLEN)
return;

if (info->noresvport)
args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;

Expand Down Expand Up @@ -283,7 +289,6 @@ static void encode_mntdirpath(struct xdr_stream *xdr, const char *pathname)
const u32 pathname_len = strlen(pathname);
__be32 *p;

BUG_ON(pathname_len > MNTPATHLEN);
p = xdr_reserve_space(xdr, 4 + pathname_len);
xdr_encode_opaque(p, pathname, pathname_len);
}
Expand Down
Loading

0 comments on commit 9e49eec

Please sign in to comment.