Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347676
b: refs/heads/master
c: 063b0fb
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Nov 26, 2012
1 parent 4a5d509 commit ad35899
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 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: ffe1137ba743cdf1c2414d5a89690aec1daa6bba
refs/heads/master: 063b0fb9fadadc0caaea6c8f31e3f6bc978a4904
26 changes: 15 additions & 11 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static struct list_head file_hashtbl[FILE_HASH_SIZE];

static void __nfs4_file_get_access(struct nfs4_file *fp, int oflag)
{
BUG_ON(!(fp->fi_fds[oflag] || fp->fi_fds[O_RDWR]));
WARN_ON_ONCE(!(fp->fi_fds[oflag] || fp->fi_fds[O_RDWR]));
atomic_inc(&fp->fi_access[oflag]);
}

Expand Down Expand Up @@ -249,7 +249,7 @@ static inline int get_new_stid(struct nfs4_stid *stid)
* preallocations that can exist at a time, but the state lock
* prevents anyone from using ours before we get here:
*/
BUG_ON(error);
WARN_ON_ONCE(error);
/*
* It shouldn't be a problem to reuse an opaque stateid value.
* I don't think it is for 4.1. But with 4.0 I worry that, for
Expand Down Expand Up @@ -494,7 +494,8 @@ static int nfs4_access_to_omode(u32 access)
case NFS4_SHARE_ACCESS_BOTH:
return O_RDWR;
}
BUG();
WARN_ON_ONCE(1);
return O_RDONLY;
}

/* release all access and file references for a given stateid */
Expand Down Expand Up @@ -1605,10 +1606,9 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
switch (exid->spa_how) {
case SP4_NONE:
break;
default: /* checked by xdr code */
WARN_ON_ONCE(1);
case SP4_SSV:
return nfserr_serverfault;
default:
BUG(); /* checked by xdr code */
case SP4_MACH_CRED:
return nfserr_serverfault; /* no excuse :-/ */
}
Expand Down Expand Up @@ -2912,7 +2912,7 @@ static void nfsd4_open_deleg_none_ext(struct nfsd4_open *open, int status)
open->op_why_no_deleg = WND4_CANCELLED;
break;
case NFS4_SHARE_WANT_NO_DELEG:
BUG(); /* not supposed to get here */
WARN_ON_ONCE(1);
}
}
}
Expand Down Expand Up @@ -3466,7 +3466,11 @@ nfs4_preprocess_stateid_op(struct net *net, struct nfsd4_compound_state *cstate,
goto out;
if (filpp) {
*filpp = dp->dl_file->fi_deleg_file;
BUG_ON(!*filpp);
if (!*filpp) {
WARN_ON_ONCE(1);
status = nfserr_serverfault;
goto out;
}
}
break;
case NFS4_OPEN_STID:
Expand Down Expand Up @@ -3693,7 +3697,7 @@ static inline void nfs4_stateid_downgrade(struct nfs4_ol_stateid *stp, u32 to_ac
case NFS4_SHARE_ACCESS_BOTH:
break;
default:
BUG();
WARN_ON_ONCE(1);
}
}

Expand Down Expand Up @@ -3882,7 +3886,7 @@ last_byte_offset(u64 start, u64 len)
{
u64 end;

BUG_ON(!len);
WARN_ON_ONCE(!len);
end = start + len;
return end > start ? end - 1: NFS4_MAX_UINT64;
}
Expand Down Expand Up @@ -4552,7 +4556,7 @@ nfs4_release_reclaim(struct nfsd_net *nn)
nfs4_remove_reclaim_record(crp, nn);
}
}
BUG_ON(nn->reclaim_str_hashtbl_size);
WARN_ON_ONCE(nn->reclaim_str_hashtbl_size);
}

/*
Expand Down

0 comments on commit ad35899

Please sign in to comment.