From: braam Date: Thu, 22 Aug 2002 18:58:20 +0000 (+0000) Subject: - minor fixes trying to get the md right. X-Git-Tag: 0.5.5~82 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a6b50957694349df12e67ab447b4facebbd32ca9;p=fs%2Flustre-release.git - minor fixes trying to get the md right. --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index da2d2af..23724c6 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -66,6 +66,7 @@ static int ll_file_open(struct inode *inode, struct file *file) oa->o_valid = OBD_MD_FLMODE | OBD_MD_FLEASIZE | OBD_MD_FLID; rc = obd_create(ll_i2obdconn(inode), oa, &lli->lli_smd); + if (rc) { obdo_free(oa); up(&lli->lli_open_sem); diff --git a/lustre/llite/super.c b/lustre/llite/super.c index fc57730..1d5dd71 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -470,16 +470,6 @@ static void ll_read_inode2(struct inode *inode, void *opaque) //if (body->valid & OBD_MD_FLSIZE) // inode->i_size = body->size; - /* Get the authoritative file size */ - if (md && md->md && inode->i_mode & S_IFREG) { - int rc; - rc = ll_file_size(inode, md->md, &inode->i_size); - if (rc) { - CERROR("ll_file_size: %d\n", rc); - /* FIXME: need to somehow prevent inode creation */ - LBUG(); - } - } //if (body->valid & OBD_MD_FLEASIZE) if (md && md->md && md->md->lmd_stripe_count) { @@ -498,6 +488,20 @@ static void ll_read_inode2(struct inode *inode, void *opaque) LBUG(); } lov_unpackmd(ii->lli_smd, smd); + } else { + ii->lli_smd = NULL; + } + + /* Get the authoritative file size */ + if (ii->lli_smd && (inode->i_mode & S_IFREG)) { + int rc; + + rc = ll_file_size(inode, ii->lli_smd, &inode->i_size); + if (rc) { + CERROR("ll_file_size: %d\n", rc); + /* FIXME: need to somehow prevent inode creation */ + LBUG(); + } } /* OIDEBUG(inode); */