@@ -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);
}
}
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(-)