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)
560560 struct hlist_node * dentry_first ;
561561 struct dentry * dentry_ptr ;
562562 struct dentry dentry ;
563+ char fname [64 ] = {};
563564 unsigned long ino ;
564565
565566 /*
@@ -595,11 +596,14 @@ void dump_mapping(const struct address_space *mapping)
595596 return ;
596597 }
597598
599+ if (strncpy_from_kernel_nofault (fname , dentry .d_name .name , 63 ) < 0 )
600+ strscpy (fname , "<invalid>" );
598601 /*
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
601604 */
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 );
603607}
604608
605609void clear_inode (struct inode * inode )
You can’t perform that action at this time.
0 commit comments