File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -459,6 +459,17 @@ int ext4_ext_migrate(struct inode *inode)
459
459
ext4_journal_stop (handle );
460
460
goto out_unlock ;
461
461
}
462
+ /*
463
+ * Use the correct seed for checksum (i.e. the seed from 'inode'). This
464
+ * is so that the metadata blocks will have the correct checksum after
465
+ * the migration.
466
+ *
467
+ * Note however that, if a crash occurs during the migration process,
468
+ * the recovery process is broken because the tmp_inode checksums will
469
+ * be wrong and the orphans cleanup will fail.
470
+ */
471
+ ei = EXT4_I (inode );
472
+ EXT4_I (tmp_inode )-> i_csum_seed = ei -> i_csum_seed ;
462
473
i_size_write (tmp_inode , i_size_read (inode ));
463
474
/*
464
475
* Set the i_nlink to zero so it will be deleted later
@@ -502,7 +513,6 @@ int ext4_ext_migrate(struct inode *inode)
502
513
goto out_tmp_inode ;
503
514
}
504
515
505
- ei = EXT4_I (inode );
506
516
i_data = ei -> i_data ;
507
517
memset (& lb , 0 , sizeof (lb ));
508
518
You can’t perform that action at this time.
0 commit comments