Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nfs: don't negate the op_status in nfs4_flexfiles_io_event tracepoints
Date: Mon, 07 Apr 2025 10:40:03 -0400	[thread overview]
Message-ID: <f1e93b5f4c1f3c3c008fc6665be02c437d386062.camel@kernel.org> (raw)
In-Reply-To: <20250407-nfs-testing-v1-1-2e637737ce76@kernel.org>

On Mon, 2025-04-07 at 10:24 -0400, Jeff Layton wrote:
> In particular, doing this makes NFS4ERR_NXIO look like -ENXIO when
> the tracepoints fire.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/nfs/nfs4trace.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
> index bc67fe6801b138204641319ecaf1115aac76af62..eb7d625d45e83f025ef96952660dded85aa0ca89 100644
> --- a/fs/nfs/nfs4trace.h
> +++ b/fs/nfs/nfs4trace.h
> @@ -2089,7 +2089,7 @@ DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event,
>  		TP_printk(
>  			"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
>  			"offset=%llu count=%u stateid=%d:0x%08x dstaddr=%s",
> -			-__entry->error,
> +			__entry->error,

It looks like there is a related problem here too. In particular,
show_nfs4_status() calls __print_symbolic, but some of the entries in
the array are duplicates.

For instance, ENXIO == 6, but NFS4ERR_NXIO is also 6. The second entry
in that array will never be matched, because ENXIO will always be found
first.

If we're going to mix errnos and nfs error codes, maybe we should
change it to treat negative values as errnos and positive ones as NFS
errors?

>  			show_nfs4_status(__entry->error),
>  			MAJOR(__entry->dev), MINOR(__entry->dev),
>  			(unsigned long long)__entry->fileid,
> 
> ---
> base-commit: e63b29244e588206f4d417ae27dc04bf1d58b982
> change-id: 20250407-nfs-testing-61217f89ee25
> 
> Best regards,

-- 
Jeff Layton <jlayton@kernel.org>

      parent reply	other threads:[~2025-04-07 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 14:24 [PATCH] nfs: don't negate the op_status in nfs4_flexfiles_io_event tracepoints Jeff Layton
2025-04-07 14:35 ` Trond Myklebust
2025-04-07 14:40 ` Jeff Layton [this message]

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=f1e93b5f4c1f3c3c008fc6665be02c437d386062.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /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