Whamcloud - gitweb
Branch: b1_4
authorgreen <green>
Mon, 15 Aug 2005 10:35:00 +0000 (10:35 +0000)
committergreen <green>
Mon, 15 Aug 2005 10:35:00 +0000 (10:35 +0000)
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
lustre/llite/namei.c

index 8d026b4..0aa1de7 100644 (file)
@@ -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. <info@clusterfs.com>
        * version 1.4.4
        * bug fixes
index c70d4b1..779c1e1 100644 (file)
@@ -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 {