Return-Path: linux-nfs-owner@vger.kernel.org Received: from mail-wi0-f180.google.com ([209.85.212.180]:64750 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754164AbaJWQQK (ORCPT ); Thu, 23 Oct 2014 12:16:10 -0400 Received: by mail-wi0-f180.google.com with SMTP id em10so2455289wid.7 for ; Thu, 23 Oct 2014 09:16:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1414079771-2960-1-git-send-email-jack@suse.cz> References: <1414079771-2960-1-git-send-email-jack@suse.cz> Date: Thu, 23 Oct 2014 19:16:09 +0300 Message-ID: Subject: Re: [PATCH] nfs: Remove dead case from nfs4_map_errors() From: Trond Myklebust To: Jan Kara Cc: Linux NFS Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-nfs-owner@vger.kernel.org List-ID: Hi Jan, On Thu, Oct 23, 2014 at 6:56 PM, Jan Kara wrote: > NFS4ERR_ACCESS has number 13 and thus is matched and returned > immediately at the beginning of nfs4_map_errors() and there's no point > in checking it later. > > Coverity-id: 733891 > Signed-off-by: Jan Kara > --- > fs/nfs/nfs4proc.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c > index 405bd95c1f58..f45e6ea1b278 100644 > --- a/fs/nfs/nfs4proc.c > +++ b/fs/nfs/nfs4proc.c > @@ -158,8 +158,6 @@ static int nfs4_map_errors(int err) > return -EACCES; > case -NFS4ERR_MINOR_VERS_MISMATCH: > return -EPROTONOSUPPORT; > - case -NFS4ERR_ACCESS: > - return -EACCES; > case -NFS4ERR_FILE_OPEN: > return -EBUSY; > default: > -- > 1.8.1.4 > Can you guarantee that EACCES will _always_ take the value 13? I don't think POSIX lists explicit values. The NFSv4 error codes are sometimes based on old Solaris error code values, and so often coincide with the Linux values, but I'm not comfortable yet with the assumption that will always be the case. Cheers Trond -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.myklebust@primarydata.com