All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Lingfeng <lilingfeng3@huawei.com>
To: <chuck.lever@oracle.com>, <jlayton@kernel.org>, <neilb@suse.de>,
	<okorniev@redhat.com>, <kolga@netapp.com>, <Dai.Ngo@oracle.com>,
	<tom@talpey.com>, <trondmy@hammerspace.com>,
	<linux-nfs@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <yukuai1@huaweicloud.com>, <houtao1@huawei.com>,
	<yi.zhang@huawei.com>, <yangerkun@huawei.com>,
	<lilingfeng@huaweicloud.com>, <lilingfeng3@huawei.com>
Subject: [PATCH 1/2] nfsd: map the ELOOP to nfserr_symlink to avoid warning
Date: Sun, 26 Jan 2025 17:50:44 +0800	[thread overview]
Message-ID: <20250126095045.738902-2-lilingfeng3@huawei.com> (raw)
In-Reply-To: <20250126095045.738902-1-lilingfeng3@huawei.com>

We got -ELOOP from ext4, resulting in the following WARNING:

VFS: Lookup of 'dc' in ext4 sdd would have caused loop
------------[ cut here ]------------
nfsd: non-standard errno: -40
WARNING: CPU: 1 PID: 297024 at fs/nfsd/vfs.c:113 nfserrno+0xc8/0x128
Modules linked in:
CPU: 1 PID: 297024 Comm: nfsd Not tainted 6.6.0-gfa4c2159cd0d-dirty #21
Hardware name: linux,dummy-virt (DT)
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : nfserrno+0xc8/0x128
lr : nfserrno+0xc8/0x128
sp : ffff8000846475a0
x29: ffff8000846475a0 x28: 0000000000000130 x27: ffff0000d65a24e8
x26: ffff0000c7319134 x25: ffff0000d6de4240 x24: 0000000000000002
x23: ffffcda9eaac3080 x22: 00000000ffffffd8 x21: 0000000000000026
x20: ffffcda9ee055000 x19: 0000000000000000 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000001 x12: ffff60001b5ca39b
x11: 1fffe0001b5ca39a x10: ffff60001b5ca39a x9 : dfff800000000000
x8 : 00009fffe4a35c66 x7 : ffff0000dae51cd3 x6 : 0000000000000001
x5 : ffff0000dae51cd0 x4 : ffff60001b5ca39b x3 : dfff800000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000ca5d8040
Call trace:
 nfserrno+0xc8/0x128
 nfsd4_encode_dirent_fattr+0x358/0x380
 nfsd4_encode_dirent+0x164/0x3a8
 nfsd_buffered_readdir+0x1a8/0x3a0
 nfsd_readdir+0x14c/0x188
 nfsd4_encode_readdir+0x1d4/0x370
 nfsd4_encode_operation+0x130/0x518
 nfsd4_proc_compound+0x394/0xec0
 nfsd_dispatch+0x264/0x418
 svc_process_common+0x584/0xc78
 svc_process+0x1e8/0x2c0
 svc_recv+0x194/0x2d0
 nfsd+0x198/0x378
 kthread+0x1d8/0x1f0
 ret_from_fork+0x10/0x20
Kernel panic - not syncing: kernel: panic_on_warn set ...

The ELOOP error in Linux indicates that too many symbolic links were
encountered in resolving a path name. Mapping it to nfserr_symlink may be
fine.

Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
---
 fs/nfsd/vfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 29cb7b812d71..0f727010b8cb 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -100,6 +100,7 @@ nfserrno (int errno)
 		{ nfserr_perm, -ENOKEY },
 		{ nfserr_no_grace, -ENOGRACE},
 		{ nfserr_io, -EBADMSG },
+		{ nfserr_symlink, -ELOOP },
 	};
 	int	i;
 
-- 
2.31.1


  reply	other threads:[~2025-01-26  9:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26  9:50 [PATCH 0/2] nfsd: add a new mapping and remove the redundant one Li Lingfeng
2025-01-26  9:50 ` Li Lingfeng [this message]
2025-01-26 17:27   ` [PATCH 1/2] nfsd: map the ELOOP to nfserr_symlink to avoid warning Chuck Lever
2025-01-27  2:33     ` Li Lingfeng
2025-01-27 13:28       ` Chuck Lever
2025-02-05  1:53         ` Li Lingfeng
2025-02-05 14:54           ` Chuck Lever
2025-02-06  1:09             ` NeilBrown
2025-01-26  9:50 ` [PATCH 2/2] nfsd: remove the redundant mapping of nfserr_mlink Li Lingfeng
2025-01-26 19:01 ` [PATCH 0/2] nfsd: add a new mapping and remove the redundant one cel
2025-01-27 14:52 ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250126095045.738902-2-lilingfeng3@huawei.com \
    --to=lilingfeng3@huawei.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=houtao1@huawei.com \
    --cc=jlayton@kernel.org \
    --cc=kolga@netapp.com \
    --cc=lilingfeng@huaweicloud.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@hammerspace.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.