Whamcloud - gitweb
Branch b_release_1_8_1
authorbobijam <bobijam>
Wed, 9 Sep 2009 09:04:29 +0000 (09:04 +0000)
committerbobijam <bobijam>
Wed, 9 Sep 2009 09:04:29 +0000 (09:04 +0000)
b=20318
o=johann
i=adilger
i=andrew.perepechko (panda)

keep same lsm in place.

lustre/llite/llite_lib.c

index 944802d..0da488f 100644 (file)
@@ -11,7 +11,7 @@
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * MERCHANTABILITY or FIRTICULAR PURPOSE.  See the GNU
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
@@ -1949,9 +1949,20 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
                         if (lli->lli_maxbytes > PAGE_CACHE_MAXBYTES)
                                 lli->lli_maxbytes = PAGE_CACHE_MAXBYTES;
                 } else {
-                        if (lli->lli_smd->lsm_magic == lsm->lsm_magic &&
-                             lli->lli_smd->lsm_stripe_count ==
+                        if ((lli->lli_smd->lsm_magic == lsm->lsm_magic ||
+                             (lli->lli_smd->lsm_magic == LOV_MAGIC_V3 &&
+                              lsm->lsm_magic == LOV_MAGIC_V1) ||
+                             (lli->lli_smd->lsm_magic == LOV_MAGIC_V1 &&
+                              lsm->lsm_magic == LOV_MAGIC_V3)) &&
+                            lli->lli_smd->lsm_stripe_count ==
                                         lsm->lsm_stripe_count) {
+                                /* The MDS can suddenly change the magic to
+                                 * v1/v3 if it has been upgraded/downgraded to a
+                                 * version that does/doesn't support OST pools.
+                                 * In this case, we consider that the cached lsm
+                                 * is equivalent to the new one and keep it in
+                                 * place until the inode is evicted from the
+                                 * cache */
                                 if (lov_stripe_md_cmp(lli->lli_smd, lsm)) {
                                         CERROR("lsm mismatch for inode %ld\n",
                                                 inode->i_ino);