提交 e2df0c86 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[PATCH] knfsd: replace some warning ins nfsfh.h with BUG_ON or WARN_ON

A couple of the warnings will be followed by an Oops if they ever fire, so may
as well be BUG_ON.  Another isn't obviously fatal but has never been known to
fire, so make it a WARN_ON.

Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 250f3915
...@@ -217,11 +217,7 @@ void fh_put(struct svc_fh *); ...@@ -217,11 +217,7 @@ void fh_put(struct svc_fh *);
static __inline__ struct svc_fh * static __inline__ struct svc_fh *
fh_copy(struct svc_fh *dst, struct svc_fh *src) fh_copy(struct svc_fh *dst, struct svc_fh *src)
{ {
if (src->fh_dentry || src->fh_locked) { WARN_ON(src->fh_dentry || src->fh_locked);
struct dentry *dentry = src->fh_dentry;
printk(KERN_ERR "fh_copy: copying %s/%s, already verified!\n",
dentry->d_parent->d_name.name, dentry->d_name.name);
}
*dst = *src; *dst = *src;
return dst; return dst;
...@@ -300,10 +296,8 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) ...@@ -300,10 +296,8 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n", dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
SVCFH_fmt(fhp), fhp->fh_locked); SVCFH_fmt(fhp), fhp->fh_locked);
if (!fhp->fh_dentry) { BUG_ON(!dentry);
printk(KERN_ERR "fh_lock: fh not verified!\n");
return;
}
if (fhp->fh_locked) { if (fhp->fh_locked) {
printk(KERN_WARNING "fh_lock: %s/%s already locked!\n", printk(KERN_WARNING "fh_lock: %s/%s already locked!\n",
dentry->d_parent->d_name.name, dentry->d_name.name); dentry->d_parent->d_name.name, dentry->d_name.name);
...@@ -328,8 +322,7 @@ fh_lock(struct svc_fh *fhp) ...@@ -328,8 +322,7 @@ fh_lock(struct svc_fh *fhp)
static inline void static inline void
fh_unlock(struct svc_fh *fhp) fh_unlock(struct svc_fh *fhp)
{ {
if (!fhp->fh_dentry) BUG_ON(!fhp->fh_dentry);
printk(KERN_ERR "fh_unlock: fh not verified!\n");
if (fhp->fh_locked) { if (fhp->fh_locked) {
fill_post_wcc(fhp); fill_post_wcc(fhp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册