lkml.org 
[lkml]   [2021]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC 09/13] mm/filemap: simplify the printing with '%pD' specifier
Date
After the behavior of '%pD' is changed to print the full path of file,
the log printing in dio_warn_stale_pagecache() can be simplified.

Given that the error case is well handled in d_path_unsafe(), the error
string would be copied in '%pD' buffer, no need to additionally handle
IS_ERR().

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jia He <justin.he@arm.com>
---
mm/filemap.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index d1458ecf2f51..477288017765 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3497,16 +3497,11 @@ EXPORT_SYMBOL(pagecache_write_end);
void dio_warn_stale_pagecache(struct file *filp)
{
static DEFINE_RATELIMIT_STATE(_rs, 86400 * HZ, DEFAULT_RATELIMIT_BURST);
- char pathname[128];
- char *path;

errseq_set(&filp->f_mapping->wb_err, -EIO);
if (__ratelimit(&_rs)) {
- path = file_path(filp, pathname, sizeof(pathname));
- if (IS_ERR(path))
- path = "(unknown)";
pr_crit("Page cache invalidation failure on direct I/O. Possible data corruption due to collision with buffered I/O!\n");
- pr_crit("File: %s PID: %d Comm: %.20s\n", path, current->pid,
+ pr_crit("File: %pD PID: %d Comm: %.20s\n", filp, current->pid,
current->comm);
}
}
--
2.17.1
\
 
 \ /
  Last update: 2021-07-15 05:17    [W:0.098 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site