public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] db: fix unsigned char related warnings
Date: Mon, 6 Nov 2023 14:21:28 -0800	[thread overview]
Message-ID: <20231106222128.GJ1205143@frogsfrogsfrogs> (raw)
In-Reply-To: <20231106065939.GA16884@lst.de>

On Mon, Nov 06, 2023 at 07:59:39AM +0100, Christoph Hellwig wrote:
> On Fri, Nov 03, 2023 at 01:38:13PM -0700, Darrick J. Wong wrote:
> > On Fri, Nov 03, 2023 at 05:02:10PM +0100, Christoph Hellwig wrote:
> > > Clean up the code in hash.c to use the normal char type for all
> > > high-level code, only casting to uint8_t when calling into low-level
> > > code.
> > > 
> > > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > 
> > The problem is deeper than just this, but we gotta start somewhere...
> 
> Is it that much bigger?
> 
> Beѕides the usual problem of casts hiding bugs I think we are fine,
> but please double check:
> 
>  - the lowlevel xfs directory entry hashing code assumes unsigned
>    chars, because of that we long compiled with -funsigned-char just
>    for XFS, which got obsoleted by the kernel doing it entirely
>    after we've switched all the low-level code to use unsigned
>    char.
>  - given that traditional unix pathnames are just NULL terminate
>    by arrays and the 7-bit CI code doesn't even look at the
>    high bit we really don't care about signed vs unsigned except
>    for the usual C pitfall when casting or shiftting
> 
> So as long as all the low-level code uses unsigned char we should
> be fine.

I'll go take a look, though that might take a day or two.

--D

      reply	other threads:[~2023-11-06 22:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 16:02 [PATCH] db: fix unsigned char related warnings Christoph Hellwig
2023-11-03 20:38 ` Darrick J. Wong
2023-11-06  6:59   ` Christoph Hellwig
2023-11-06 22:21     ` Darrick J. Wong [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=20231106222128.GJ1205143@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.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