From 3e658e522a8f925b3bf36855aef646f5189936b1 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 26 Sep 2003 23:42:15 +0000 Subject: [PATCH] Fix minor codingstyle and whitespace issues with ll_prep_inode change. Avoid oops in ll_iget if we get a NULL inode back. --- lustre/llite/llite_lib.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index c78c7ec..b69c28a 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -788,29 +788,27 @@ void ll_umount_begin(struct super_block *sb) EXIT; } -int ll_prep_inode(struct obd_export *exp, struct inode **inode, - struct ptlrpc_request *req, int offset, struct super_block *sb) +int ll_prep_inode(struct obd_export *exp, struct inode **inode, + struct ptlrpc_request *req, int offset,struct super_block *sb) { struct lustre_md md; int rc = 0; - + rc = mdc_req2lustre_md(req, offset, exp, &md); if (rc) RETURN(rc); - if (*inode) + if (*inode) { ll_update_inode(*inode, md.body, md.lsm); - else { + } else { LASSERT(sb); *inode = ll_iget(sb, md.body->ino, &md); - if (!*inode || is_bad_inode(*inode)) { + if (!*inode) { /* free the lsm if we allocated one above */ if (md.lsm != NULL) obd_free_memmd(exp, &md.lsm); - /* XXX might need iput() for bad inode */ rc = -ENOMEM; CERROR("new_inode -fatal: rc %d\n", rc); - LBUG(); } } -- 1.8.3.1