9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] 5c bug
Date: Thu, 25 Jul 2019 12:59:57 +0100	[thread overview]
Message-ID: <CAOw7k5h7sgZ+jrr3MAJuLPX-dLSzW=p-zAwPwkGKAMOdRFvPMw@mail.gmail.com> (raw)
In-Reply-To: <27721ec6eb1f2bf4019349b1013e6d26@quintile.net>

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

5c shouldn't discard the cast, which implies a mask, but you should also
rewrite the code as you suggest.
(it's not just 5c, since it's the same for several other RISCy ones.)


On Thu, Jul 25, 2019 at 12:20 PM Steve Simon <steve@quintile.net> wrote:

> Hi,
>
> I traced a long standing cifs issue to 5c the compiler.
>
> The code in lib9p to validate wstat calls
> uses a neat bit of casting which fails when using 5c.
>
> /sys/src/lib9p/srv.c:658-669
>
> These following lines missfire reporting type or qid change
> when trying to rename files over cifs.
>
>         if((ushort)~r->d.type){
>         ...
>         if((uchar)~r->d.qid.type || .. ){
>
> but rewriting them like this makes the code work as expected:
>
>         if(r->d.type != (ushort)~0){
>         ...
>         if(r->d.qid.type != (uchar)~0 || ... )
>
> Personally I am happy to hack lib9p but the worry is that
> this bug might be affecting other things.
>
> I have no knowledge of the internals of the compilers so
> I am afraid I have made no attempt to dig deeper.
>
> -Steve
>
>

[-- Attachment #2: Type: text/html, Size: 1505 bytes --]

      reply	other threads:[~2019-07-25 11:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 11:19 Steve Simon
2019-07-25 11:59 ` Charles Forsyth [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='CAOw7k5h7sgZ+jrr3MAJuLPX-dLSzW=p-zAwPwkGKAMOdRFvPMw@mail.gmail.com' \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).