diff --git a/fs/ext4/file.c b/fs/ext4/file.c index fd7ce3573a00a..1513e90fb6d2f 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -432,7 +432,7 @@ static int ext4_sample_last_mounted(struct super_block *sb, err = ext4_journal_get_write_access(handle, sbi->s_sbh); if (err) goto out_journal; - strlcpy(sbi->s_es->s_last_mounted, cp, + strncpy(sbi->s_es->s_last_mounted, cp, sizeof(sbi->s_es->s_last_mounted)); ext4_handle_dirty_super(handle, sb); out_journal: