Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1553575ybg; Tue, 2 Jun 2020 13:11:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8Fumh+itFkKBktNektrT/wJohf8lrbk8L2ax8wuj5IIpwmcekdpCM1By6YN/ufJG6wVAR X-Received: by 2002:a17:906:6890:: with SMTP id n16mr15116185ejr.553.1591128712394; Tue, 02 Jun 2020 13:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591128712; cv=none; d=google.com; s=arc-20160816; b=NbYb/ew6hkWc9kOGjf3ZrF/A5nvqFbZ9ziTMuJuLlwINtg4K0hK3LerMOl196PWO74 pyETOh+FYqsLMD2vWeknjcDditmI6AShB7oeN1jhqTs2PWWGiaUHlrf/WSn1Xw4sHZ1W gyDLdcMjJeYWKyQaoTqa7SHx2Qz8ZOqArJldEZ1uolQt5GNAW38uxMtuHbtdIQmcAwV0 k3oW354e8HoBmA690JuZObddhl1o5ESM7U4qCyBgc3twRETbu+4QiddVk2FgjNMSxNfX 3a0u1/B628gqIMXpzS1MOAwgPOvkic/He66QPzu4YcAF4EhSZ4CTCiZ5bDnA1kT3YnVC Z6Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=lSJBI0WlEWC4Zxs74MDpJOTEJ9Frie3/kAPmbLjWaQE=; b=ZCqMx34bh1quPTWi1a1pdDqm1I+D86hzRbucOnr+KJMe7SeMercs9u34Z/alirSWN6 lR6moOy2Tga6+lYPgQn/UdNXEEhxnFFKDuRDUc3AR/7pcERC/lcrkJczSeYRBHT26CuX pgYfsG8g5kEwQG8sVhDZO2BOzhgeVF0jCknTosujpHZte2uGBh1+5AGvzvnGkvrGGgz9 A8AjfjCpqJAUozYhRTuTJIi7f90sD2GL01YOrESN0qBXdq4fY+kGB/u6sBHwjcbDs+eN tpC92R84WctNRUpHpJddyDdLooeY3cDKd3hXyxk3tApfgKTYAOwKiLQlne00kql4S15n 1IRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si2024980ejr.30.2020.06.02.13.11.18; Tue, 02 Jun 2020 13:11:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbgFBULM (ORCPT + 99 others); Tue, 2 Jun 2020 16:11:12 -0400 Received: from fieldses.org ([173.255.197.46]:33898 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726842AbgFBULL (ORCPT ); Tue, 2 Jun 2020 16:11:11 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 50CC84EF4; Tue, 2 Jun 2020 16:11:11 -0400 (EDT) Date: Tue, 2 Jun 2020 16:11:11 -0400 To: Kenneth D'souza Cc: linux-nfs@vger.kernel.org, bfields@redhat.com Subject: Re: [PATCH] nfs4_setfacl: Add file name to error output. Message-ID: <20200602201111.GE1769@fieldses.org> References: <20200601192754.5413-1-kdsouza@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200601192754.5413-1-kdsouza@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Thanks, applied.--b. On Tue, Jun 02, 2020 at 12:57:54AM +0530, Kenneth D'souza wrote: > Currently when a user tries to set acl's recursively and if > the operation fails the user is not aware on which file the error > occured. This patch adds file name to error output. > > Example: > nfs4_setfacl -R -s A:dfg:6:RWX /nfsmount > Failed setxattr operation: /nfsmount/test: Operation not permitted > An error occurred during recursive file tree walk. > > Signed-off-by: Kenneth D'souza > --- > libnfs4acl/nfs4_set_acl.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libnfs4acl/nfs4_set_acl.c b/libnfs4acl/nfs4_set_acl.c > index 8a53f05..45e42fa 100644 > --- a/libnfs4acl/nfs4_set_acl.c > +++ b/libnfs4acl/nfs4_set_acl.c > @@ -61,13 +61,13 @@ int nfs4_set_acl(struct nfs4_acl *acl, const char *path) > goto out_free; > } else if (res < 0) { > if (errno == EOPNOTSUPP) > - fprintf(stderr,"Operation to set ACL not supported.\n"); > + fprintf(stderr,"Operation to set ACL not supported: %s\n", path); > else if (errno == ENODATA) > - fprintf(stderr,"ACL Attribute not found on file.\n"); > + fprintf(stderr,"ACL Attribute not found on file: %s\n", path); > else if (errno == EREMOTEIO) > fprintf(stderr,"An NFS server error occurred.\n"); > else > - perror("Failed setxattr operation"); > + printf("Failed setxattr operation: %s: %s\n", path, strerror(errno)); > } > > out_free: > -- > 2.21.1