@@ -120,10 +120,10 @@ void __dump_mmp_msg(struct super_block *sb, struct mmp_struct *mmp,
120
120
{
121
121
__ext4_warning (sb , function , line , "%s" , msg );
122
122
__ext4_warning (sb , function , line ,
123
- "MMP failure info: last update time: %llu, last update "
124
- "node: %s, last update device: %s" ,
125
- (long long unsigned int ) le64_to_cpu (mmp -> mmp_time ) ,
126
- mmp -> mmp_nodename , mmp -> mmp_bdevname );
123
+ "MMP failure info: last update time: %llu, last update node: %.*s, last update device: %.*s" ,
124
+ ( unsigned long long ) le64_to_cpu ( mmp -> mmp_time ) ,
125
+ (int )sizeof (mmp -> mmp_nodename ), mmp -> mmp_nodename ,
126
+ ( int ) sizeof ( mmp -> mmp_bdevname ) , mmp -> mmp_bdevname );
127
127
}
128
128
129
129
/*
@@ -154,6 +154,7 @@ static int kmmpd(void *data)
154
154
mmp_check_interval = max (EXT4_MMP_CHECK_MULT * mmp_update_interval ,
155
155
EXT4_MMP_MIN_CHECK_INTERVAL );
156
156
mmp -> mmp_check_interval = cpu_to_le16 (mmp_check_interval );
157
+ BUILD_BUG_ON (sizeof (mmp -> mmp_bdevname ) < BDEVNAME_SIZE );
157
158
bdevname (bh -> b_bdev , mmp -> mmp_bdevname );
158
159
159
160
memcpy (mmp -> mmp_nodename , init_utsname ()-> nodename ,
@@ -379,7 +380,8 @@ int ext4_multi_mount_protect(struct super_block *sb,
379
380
/*
380
381
* Start a kernel thread to update the MMP block periodically.
381
382
*/
382
- EXT4_SB (sb )-> s_mmp_tsk = kthread_run (kmmpd , mmpd_data , "kmmpd-%s" ,
383
+ EXT4_SB (sb )-> s_mmp_tsk = kthread_run (kmmpd , mmpd_data , "kmmpd-%.*s" ,
384
+ (int )sizeof (mmp -> mmp_bdevname ),
383
385
bdevname (bh -> b_bdev ,
384
386
mmp -> mmp_bdevname ));
385
387
if (IS_ERR (EXT4_SB (sb )-> s_mmp_tsk )) {
0 commit comments