]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Adjust fs_context error logging
authorScott Mayhew <smayhew@redhat.com>
Tue, 5 Jan 2021 13:54:32 +0000 (08:54 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 10 Jan 2021 18:32:39 +0000 (13:32 -0500)
commit6b954fd09491ac7920926bf70b7057eef4066a92
treed33ee04b98db2c4af4487dda7b5c73381befcfe9
parent28e2ee6dfcff061032c96d89271bd148f65559af
NFS: Adjust fs_context error logging

Several existing dprink()/dfprintk() calls were converted to use the new
mount API logging macros by commit b7ba2a5b066c ("NFS: Attach
supplementary error information to fs_context").  If the fs_context was
not created using fsopen() then it will not have had a log buffer
allocated for it, and the new mount API logging macros will wind up
calling printk().

This can result in syslog messages being logged where previously there
were none... most notably "NFS4: Couldn't follow remote path", which can
happen if the client is auto-negotiating a protocol version with an NFS
server that doesn't support the higher v4.x versions.

Convert the nfs_errorf(), nfs_invalf(), and nfs_warnf() macros to check
for the existence of the fs_context's log buffer and call dprintk() if
it doesn't exist.  Add nfs_ferrorf(), nfs_finvalf(), and nfs_warnf(),
which do the same thing but take an NFS debug flag as an argument and
call dfprintk().  Finally, modify the "NFS4: Couldn't follow remote
path" message to use nfs_ferrorf().

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207385
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Fixes: b7ba2a5b066c ("NFS: Attach supplementary error information to fs_context.")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/internal.h
fs/nfs/nfs4super.c