From nobody Fri Apr 26 03:51:55 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VQf1L6kz1z5HldK for ; Fri, 26 Apr 2024 03:52:06 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VQf1L1z8Cz4ckS; Fri, 26 Apr 2024 03:52:06 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6ed0e9ccca1so1643215b3a.0; Thu, 25 Apr 2024 20:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714103525; x=1714708325; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=u4hDkyQQil4QJrg0rGEBWy7PxibZtKbVtRkkWsbPRwM=; b=O85L34Zz+LsihciuJQ0GXboD3YZNaD5LHT6i1bH2WYYTHORm072hHEmjbEvddEIXB5 f72eZMu1vhb6mCFQKtPvMTqUywo3dAoFpDDR7ILWsJiQV+QGSdV68q5Ac2B2JV1nXLbr m19sEi7lx9M/VqUjxZqV2f4WuNjVPgtedhbYulCwpLTley5pMXz7AEm70Zw7KigLCyXY HP3MEl2+ycqx+GcAQwCzofptmbyo2NprMFXdjBL6rYx+Lc+tRDQ3kOLohkB9y4tBcGzq G4SPOFFcagoY9BnMzABkKo9ecel5D7s3qQwHQincO20b7UZDBkJO0A9iV0WT11+JPaLl qpdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714103525; x=1714708325; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u4hDkyQQil4QJrg0rGEBWy7PxibZtKbVtRkkWsbPRwM=; b=vO1LtxhzmkeWvUl5d37QRteZKagMWG/QNOfZnhxD95YmC0/bwaYD6ryiGhVF6VAIzW 2fS6KYL+XyteKqywoQ+HhjxrV/Yz6QI1/tZJ2ac/c1vOyUyKsKbYQPmpERpphmolGseg gfyFeCU+2JzsDWMM3ePpcqFjGl/338QQLAqBzTfz6Tkg9umrqdN66cyXTMEJtWvUTFiO MNvbKC2r9Nt5j1pcgz0muSNfTQMVd9WUEbBpldEqx8qs27OsY2fWWSUpLfcZlLIlfAu9 ueIEZBxQErxkVu6kqMO26MYRfZJUY0pO2ZLJ4EVvmGS1rQiuOR+T3UXPt5JhliJG4j68 14Eg== X-Gm-Message-State: AOJu0YybepFozNSGN1DFC1JyRuWGLvYdqXRRE1AuBIgDFAo5LIA67tat Ga1pWU/XGac2ZztlX/ZE6LsBEDNMMbbJ6PdH+vvyyHWzdSWXWOx9LG8V1NpVwD5Ikaud/FUq3BC R5DvO+kjOQBPMJpcKnASFuhHR5lP9 X-Google-Smtp-Source: AGHT+IESScytHrWAAeyX+/XlhVTtohF9SGTvn1qJ5nNhgczK/SZ/PXDftQoQyoAvkHNHhCz1pwqwUfBWRs1TEj2yVcQ= X-Received: by 2002:a05:6a20:8783:b0:1a6:b689:8c29 with SMTP id g3-20020a056a20878300b001a6b6898c29mr1265145pzf.61.1714103524584; Thu, 25 Apr 2024 20:52:04 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Rick Macklem Date: Thu, 25 Apr 2024 20:51:55 -0700 Message-ID: Subject: Re: mysterious setting of B_DIRECT? To: Konstantin Belousov Cc: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4VQf1L1z8Cz4ckS On Thu, Apr 25, 2024 at 8:09=E2=80=AFPM Konstantin Belousov 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_directwri= te() > > 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 buf" > > 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. Thanks, rick