Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2024 20:54:48 -0700
From:      Rick Macklem <rick.macklem@gmail.com>
To:        Konstantin Belousov <kib@freebsd.org>
Cc:        FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: mysterious setting of B_DIRECT?
Message-ID:  <CAM5tNy7b6tjX4j5bE6TahM5jSbhydpkcJSExKz9rOJ-J9va7XQ@mail.gmail.com>
In-Reply-To: <CAM5tNy6ZxUK99X74paBpXuZOr=X2QND7BAvmRCJi9gMZmRMWLQ@mail.gmail.com>
References:  <CAM5tNy4bJC9p66_cBYBSdcxDTWwtFUcOvjfxf=a8B%2BA%2B9s_HSg@mail.gmail.com> <Zisa7pOcI4lcXhq3@kib.kiev.ua> <CAM5tNy6ZxUK99X74paBpXuZOr=X2QND7BAvmRCJi9gMZmRMWLQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 25, 2024 at 8:51=E2=80=AFPM Rick Macklem <rick.macklem@gmail.co=
m> wrote:
>
> On Thu, Apr 25, 2024 at 8:09=E2=80=AFPM Konstantin Belousov <kib@freebsd.=
org> wrote:
> >
> > On Thu, Apr 25, 2024 at 07:49:23PM -0700, Rick Macklem wrote:
> > > Hi,
> > >
> > > This week I have been doing active testing as a part of an IETF
> > > bakeathon for NFSv4. During the week I had a NFSv4 client
> > > crash. On the surface, it is straightforward, in that it called
> > > ncl_doio_directwrite() and the field called b_caller1 was NULL.
> > >
> > > Now, here's the weird part...
> > > ncl_doio_directwrite() should never be called because B_DIRECT
> > > should never be set. (The only place B_DIRECT gets set in the code
> > > is never currently executed.)
> > Do you mean the place in nfs_directio_write()?  And the fact that
> > IO_SYNC is always set.
> Yes.
>
> >
> > >
> > > I have a patch that clears out the "never to be executed" code and
> > > this seems to avoid the patch, since with the patch, ncl_doio_directw=
rite()
> > > no longer exists.
> > >
> > > What I cannot figure out is how B_DIRECT got set?
> > > I can note that UFS was under heavy load when the client crashed,
> > > but I cannot see how a UFS "struct buf" would become a NFS "struct bu=
f"
> > > without b_flags being set to 0.
> >
> > There are also vfs_bio_brelse()/vfs_bio_setflags() functions which can
> > set B_DIRECT.  On the other hand, they are not used by nfs client.
> Yes, again.
>
> >
> > What was the overall state of the buffer with the B_DIRECT flag?  Which
> > vnode it was assigned to?
> Unfortunately I was in a hurry and didn't get more info.
> And, since I have never seen this crash before, I doubt I'll be able
> to reproduce it.
Oh, and I will put the cleanup patch on phabricator. I didn't see the
crash again
during a few days of testing with the patch. This makes sense, since it get=
s
rid of ncl_doio_directwrite().

>
> Thanks, rick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM5tNy7b6tjX4j5bE6TahM5jSbhydpkcJSExKz9rOJ-J9va7XQ>