From fdc31d245cc5f62274cf5537391a3567717949d6 Mon Sep 17 00:00:00 2001 From: green Date: Mon, 15 Aug 2005 10:35:00 +0000 Subject: [PATCH] Branch: b1_4 b=7198 r=adilger Do not double-query file size from OSTs during stat(2). This might slow down things considerably if somebody actively writes to stat()ed files too. --- lustre/ChangeLog | 6 ++++++ lustre/llite/namei.c | 25 ++++++++----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 8d026b4..0aa1de7 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -60,6 +60,12 @@ Details : By echoing "nid:$NID" string into $NID would be instantly evicted from this MDS and from all active OSTs connected to it. +Severity : minor +Bugzilla : 7198 +Description: Do not query file size twice, somewhat slowing stat(2) calls. +Details : lookup_it_finish() used to query file size from OSTs that was not + needed. + 2005-08-08 Cluster File Systems, Inc. * version 1.4.4 * bug fixes diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index c70d4b1..779c1e1 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -352,23 +352,14 @@ static int lookup_it_finish(struct ptlrpc_request *request, int offset, inode, inode->i_ino, inode->i_generation); mdc_set_lock_data(&it->d.lustre.it_lock_handle, inode); - /* If this is a stat, get the authoritative file size */ - if (it->it_op == IT_GETATTR && S_ISREG(inode->i_mode) && - ll_i2info(inode)->lli_smd != NULL) { - struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd; - ldlm_error_t rc; - - LASSERT(lsm->lsm_object_id != 0); - - /* bug 2334: drop MDS lock before acquiring OST lock */ - ll_intent_drop_lock(it); - - rc = ll_glimpse_size(inode); - if (rc) { - iput(inode); - RETURN(rc); - } - } + /* We used to query real size from OSTs here, but actually + this is not needed. For stat() calls size would be updated + from subsequent do_revalidate()->ll_inode_revalidate_it() in + 2.4 and + vfs_getattr_it->ll_getattr()->ll_inode_revalidate_it() in 2.6 + Everybody else who needs correct file size would call + ll_glimpse_size or some equivalent themselves anyway. + Also see bug 7198. */ *de = ll_find_alias(inode, *de); } else { -- 1.8.3.1