From patchwork Fri Mar 10 01:52:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 9614479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EEF47602B4 for ; Fri, 10 Mar 2017 01:52:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE1FA286EB for ; Fri, 10 Mar 2017 01:52:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D14B1286F3; Fri, 10 Mar 2017 01:52:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FB99286EB for ; Fri, 10 Mar 2017 01:52:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754006AbdCJBw3 (ORCPT ); Thu, 9 Mar 2017 20:52:29 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:33443 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753945AbdCJBw2 (ORCPT ); Thu, 9 Mar 2017 20:52:28 -0500 Received: by mail-io0-f194.google.com with SMTP id f84so5729799ioj.0 for ; Thu, 09 Mar 2017 17:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=P97fuQ0/3ZnSIDO+dZlIjfLqBSJnrXKokLWiVPqIs6U=; b=HLdx9nEYszSj6c6qHZJnSlyk2UiF0O2yQiqnNicoGoK/zkf73fFLubqYeLuYaHBh8P FbkTwPYSD4WWYYggkM8Ex4C5VWTpw9FEDBwrvcbmJqJ+RN0UL9i8KaKb6KIU9r6nsmdx mhw0fsPWfolaXxEUvuiTXgjLpBmQrpTKY6scfHp6vXHT2kE8/qQNJGW2wR+NgnG64EWe JVLk+3pOdtFlpxsXugjNAQbJ0In+KxMe5l5GLy8Ye330HB83YeGKHKmK9NGnjsff4FmB sKK3p5a/mwS3o3aMRZSLt7KGFtT9MidJYU+Xr8C7GtrxoPJqA9lxIG8uCLCTCQL0D2Zc ziFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=P97fuQ0/3ZnSIDO+dZlIjfLqBSJnrXKokLWiVPqIs6U=; b=rkyaTEyjtrhcFtSLkjBzJy+4k2FQ5Uvw/H6l2AFeGxADWD4+kvF9Wvm5wkZK/tR9cZ 9YArW4NBnTt8P3xJZb6WtD+61cMzGi/HJ1ZQlx69zcMNA7Vysqt0Zi91z0S+z57Y3d7S 009MV2YnJhTjjmrX6D+/C2ldM95LdtCuVrySiClg4r5Ffq0fUm/oAEygWXjen7XnYoEU yIYFSCbeinWhq1qxFZ1k2gE71eGWkePT3lut0gXNlos+Cgbad4+kjm5flKFeOMq41DcZ qEpBC1qPQzyfADfJn6FDHrmsAOKfuz+9jVwrW66eKhGdYjq7a/zs+zSCg44XaaFcd0P5 I7uA== X-Gm-Message-State: AMke39k55ARvVUdAk45FuVZz1ntVJw/fZCb7JakNHZKSdaMESteuzn62tfnTOIvZTsELIg== X-Received: by 10.107.85.2 with SMTP id j2mr16585858iob.165.1489110747135; Thu, 09 Mar 2017 17:52:27 -0800 (PST) Received: from [192.168.0.106] ([183.228.28.193]) by smtp.gmail.com with ESMTPSA id f85sm3767330ioi.26.2017.03.09.17.52.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 17:52:26 -0800 (PST) From: Kinglong Mee Subject: [PATCH] nfsd: map the ENOKEY to nfserr_perm for avoiding warning To: "J. Bruce Fields" , "linux-nfs@vger.kernel.org" Cc: Kinglong Mee Message-ID: Date: Fri, 10 Mar 2017 09:52:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ext4 and f2fs filesystems support encrypted directories and files now, access those files may return ENOKEY error, so that the following WARNING will be showed out. Maybe maps ENOKEY to nfserr_perm is better than nfserr_io. [ 1295.411759] ------------[ cut here ]------------ [ 1295.411787] WARNING: CPU: 0 PID: 12786 at fs/nfsd/nfsproc.c:796 nfserrno+0x74/0x80 [nfsd] [ 1295.411806] nfsd: non-standard errno: -126 [ 1295.411816] Modules linked in: nfsd nfs_acl auth_rpcgss nfsv4 nfs lockd fscache tun bridge stp llc fuse ip_set nfnetlink vmw_vsock_vmci_transport vsock snd_seq_midi snd_seq_midi_event coretemp crct10dif_pclmul crc32_generic crc32_pclmul snd_ens1371 gameport ghash_clmulni_intel snd_ac97_codec f2fs intel_rapl_perf ac97_bus snd_seq ppdev snd_pcm snd_rawmidi snd_timer vmw_balloon snd_seq_device snd joydev soundcore parport_pc parport nfit acpi_cpufreq tpm_tis vmw_vmci tpm_tis_core tpm shpchp i2c_piix4 grace sunrpc xfs libcrc32c vmwgfx drm_kms_helper ttm drm crc32c_intel e1000 mptspi scsi_transport_spi serio_raw mptscsih mptbase ata_generic pata_acpi fjes [last unloaded: nfs_acl] [ 1295.412522] CPU: 0 PID: 12786 Comm: nfsd Tainted: G W 4.11.0-rc1+ #521 [ 1295.412959] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015 [ 1295.413814] Call Trace: [ 1295.414252] dump_stack+0x63/0x86 [ 1295.414666] __warn+0xcb/0xf0 [ 1295.415087] warn_slowpath_fmt+0x5f/0x80 [ 1295.415502] ? put_filp+0x42/0x50 [ 1295.415927] nfserrno+0x74/0x80 [nfsd] [ 1295.416339] nfsd_open+0xd7/0x180 [nfsd] [ 1295.416746] nfs4_get_vfs_file+0x367/0x3c0 [nfsd] [ 1295.417182] ? security_inode_permission+0x41/0x60 [ 1295.417591] nfsd4_process_open2+0x9b2/0x1200 [nfsd] [ 1295.418007] nfsd4_open+0x481/0x790 [nfsd] [ 1295.418409] nfsd4_proc_compound+0x395/0x680 [nfsd] [ 1295.418812] nfsd_dispatch+0xb8/0x1f0 [nfsd] [ 1295.419233] svc_process_common+0x4d9/0x830 [sunrpc] [ 1295.419631] svc_process+0xfe/0x1b0 [sunrpc] [ 1295.420033] nfsd+0xe9/0x150 [nfsd] [ 1295.420420] kthread+0x101/0x140 [ 1295.420802] ? nfsd_destroy+0x60/0x60 [nfsd] [ 1295.421199] ? kthread_park+0x90/0x90 [ 1295.421598] ret_from_fork+0x2c/0x40 [ 1295.421996] ---[ end trace 0d5a969cd7852e1f ]--- Signed-off-by: Kinglong Mee --- fs/nfsd/nfsproc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index fa82b77..03a7e9d 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c @@ -786,6 +786,7 @@ nfserrno (int errno) { nfserr_serverfault, -ESERVERFAULT }, { nfserr_serverfault, -ENFILE }, { nfserr_io, -EUCLEAN }, + { nfserr_perm, -ENOKEY }, }; int i;