@@ -1427,6 +1427,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode)
1427
1427
lvb -> lvb_imtime_packed =
1428
1428
cpu_to_be64 (ocfs2_pack_timespec (& inode -> i_mtime ));
1429
1429
lvb -> lvb_iattr = cpu_to_be32 (oi -> ip_attr );
1430
+ lvb -> lvb_igeneration = cpu_to_be32 (inode -> i_generation );
1430
1431
1431
1432
mlog_meta_lvb (0 , lockres );
1432
1433
@@ -1482,11 +1483,13 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode)
1482
1483
mlog_exit_void ();
1483
1484
}
1484
1485
1485
- static inline int ocfs2_meta_lvb_is_trustable (struct ocfs2_lock_res * lockres )
1486
+ static inline int ocfs2_meta_lvb_is_trustable (struct inode * inode ,
1487
+ struct ocfs2_lock_res * lockres )
1486
1488
{
1487
1489
struct ocfs2_meta_lvb * lvb = (struct ocfs2_meta_lvb * ) lockres -> l_lksb .lvb ;
1488
1490
1489
- if (lvb -> lvb_version == OCFS2_LVB_VERSION )
1491
+ if (lvb -> lvb_version == OCFS2_LVB_VERSION
1492
+ && be32_to_cpu (lvb -> lvb_igeneration ) == inode -> i_generation )
1490
1493
return 1 ;
1491
1494
return 0 ;
1492
1495
}
@@ -1583,7 +1586,7 @@ static int ocfs2_meta_lock_update(struct inode *inode,
1583
1586
* map (directories, bitmap files, etc) */
1584
1587
ocfs2_extent_map_trunc (inode , 0 );
1585
1588
1586
- if (ocfs2_meta_lvb_is_trustable (lockres )) {
1589
+ if (ocfs2_meta_lvb_is_trustable (inode , lockres )) {
1587
1590
mlog (0 , "Trusting LVB on inode %llu\n" ,
1588
1591
(unsigned long long )oi -> ip_blkno );
1589
1592
ocfs2_refresh_inode_from_lvb (inode );
@@ -3166,8 +3169,9 @@ void ocfs2_dump_meta_lvb_info(u64 level,
3166
3169
3167
3170
mlog (level , "LVB information for %s (called from %s:%u):\n" ,
3168
3171
lockres -> l_name , function , line );
3169
- mlog (level , "version: %u, clusters: %u\n" ,
3170
- lvb -> lvb_version , be32_to_cpu (lvb -> lvb_iclusters ));
3172
+ mlog (level , "version: %u, clusters: %u, generation: 0x%x\n" ,
3173
+ lvb -> lvb_version , be32_to_cpu (lvb -> lvb_iclusters ),
3174
+ be32_to_cpu (lvb -> lvb_igeneration ));
3171
3175
mlog (level , "size: %llu, uid %u, gid %u, mode 0x%x\n" ,
3172
3176
(unsigned long long )be64_to_cpu (lvb -> lvb_isize ),
3173
3177
be32_to_cpu (lvb -> lvb_iuid ), be32_to_cpu (lvb -> lvb_igid ),
0 commit comments