public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Khem Raj <raj.khem@gmail.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
	Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: Re: [PATCH v2 1/2] mountd: Check for return of stat function
Date: Tue, 13 Sep 2022 13:37:08 -0400	[thread overview]
Message-ID: <0429dc4f-e9a6-34fd-1572-0eab2708d3f5@redhat.com> (raw)
In-Reply-To: <20220816024403.2694169-1-raj.khem@gmail.com>



On 8/15/22 10:44 PM, Khem Raj wrote:
> simplify the check, stat() return 0 on success -1 on failure
> 
> Fixes clang reported errors e.g.
> 
> | v4clients.c:29:6: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
> |         if (!stat("/proc/fs/nfsd/clients", &sb) == 0 ||
> |             ^                                   ~~
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Committed... (tag: nfs-utils-2-6-3-rc1)

steved
> Cc: Konstantin Khorenko <khorenko@virtuozzo.com>
> Cc: Steve Dickson <steved@redhat.com>
> ---
> v2: rebased
> 
>   support/export/v4clients.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/support/export/v4clients.c b/support/export/v4clients.c
> index 5f15b61..3230251 100644
> --- a/support/export/v4clients.c
> +++ b/support/export/v4clients.c
> @@ -26,7 +26,7 @@ void v4clients_init(void)
>   {
>   	struct stat sb;
>   
> -	if (!stat("/proc/fs/nfsd/clients", &sb) == 0 ||
> +	if (stat("/proc/fs/nfsd/clients", &sb) != 0 ||
>   	    !S_ISDIR(sb.st_mode))
>   		return;
>   	if (clients_fd >= 0)


  parent reply	other threads:[~2022-09-13 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16  2:44 [PATCH v2 1/2] mountd: Check for return of stat function Khem Raj
2022-08-16  2:44 ` [PATCH v2 2/2] Fix function prototypes Khem Raj
2022-09-13 17:37   ` Steve Dickson
2022-09-13 17:37 ` Steve Dickson [this message]
2022-09-13 17:38 ` [PATCH v2 1/2] mountd: Check for return of stat function Steve Dickson

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=0429dc4f-e9a6-34fd-1572-0eab2708d3f5@redhat.com \
    --to=steved@redhat.com \
    --cc=khorenko@virtuozzo.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=raj.khem@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox