[RH7] fs/dcache: show fs_type in warning about unnamed root entry

Submitted by Pavel Tikhomirov on May 28, 2018, 3:55 p.m.

Details

Message ID 20180528155554.20196-1-ptikhomirov@virtuozzo.com
State New
Series "fs/dcache: show fs_type in warning about unnamed root entry"
Headers show

Commit Message

Pavel Tikhomirov May 28, 2018, 3:55 p.m.
We have a noizy warning from customer:

 Call Trace:
  [<ffffffff816a02f8>] dump_stack+0x19/0x1b
  [<ffffffff81088be8>] __warn+0xd8/0x100
  [<ffffffff81088c6f>] warn_slowpath_fmt+0x5f/0x80
  [<ffffffff8123472f>] prepend_path+0x25f/0x320
  [<ffffffff812348d5>] d_path+0xe5/0x150
  [<ffffffff8128f04d>] proc_pid_readlink+0x9d/0x100
  [<ffffffff8122121b>] SyS_readlinkat+0x9b/0x130
  [<ffffffff812212cb>] SyS_readlink+0x1b/0x20
  [<ffffffff816b1649>] system_call_fastpath+0x16/0x1b
 ---[ end trace c117274d77e2a060 ]---

Knowing which fs is involved behind /proc/pid/smth will help much.

https://jira.sw.ru/browse/PSBM-78310

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 fs/dcache.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/dcache.c b/fs/dcache.c
index 2cb018a05078..8ec9b2a7cbde 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3010,9 +3010,10 @@  static int prepend_path(const struct path *path,
 			if (IS_ROOT(dentry) &&
 			   (dentry->d_name.len != 1 ||
 			    dentry->d_name.name[0] != '/')) {
-				WARN(1, "Root dentry has weird name <%.*s>\n",
+				WARN(1, "Root dentry has weird name <%.*s> fs=%s\n",
 				     (int) dentry->d_name.len,
-				     dentry->d_name.name);
+				     dentry->d_name.name,
+				     dentry->d_sb->s_type->name);
 			}
 			if (!error)
 				error = is_mounted(vfsmnt) ? 1 : 2;