File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -560,6 +560,7 @@ void dump_mapping(const struct address_space *mapping)
560
560
struct hlist_node * dentry_first ;
561
561
struct dentry * dentry_ptr ;
562
562
struct dentry dentry ;
563
+ char fname [64 ] = {};
563
564
unsigned long ino ;
564
565
565
566
/*
@@ -595,11 +596,14 @@ void dump_mapping(const struct address_space *mapping)
595
596
return ;
596
597
}
597
598
599
+ if (strncpy_from_kernel_nofault (fname , dentry .d_name .name , 63 ) < 0 )
600
+ strscpy (fname , "<invalid>" );
598
601
/*
599
- * if dentry is corrupted, the %pd handler may still crash ,
600
- * but it's unlikely that we reach here with a corrupt mapping
602
+ * Even if strncpy_from_kernel_nofault() succeeded ,
603
+ * the fname could be unreliable
601
604
*/
602
- pr_warn ("aops:%ps ino:%lx dentry name:\"%pd\"\n" , a_ops , ino , & dentry );
605
+ pr_warn ("aops:%ps ino:%lx dentry name(?):\"%s\"\n" ,
606
+ a_ops , ino , fname );
603
607
}
604
608
605
609
void clear_inode (struct inode * inode )
You can’t perform that action at this time.
0 commit comments