From nobody Fri Apr 26 03:54:48 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 4VQf4j4XWHz5HlRr for ; Fri, 26 Apr 2024 03:55:01 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (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 4VQf4g5NMcz4dv1; Fri, 26 Apr 2024 03:54:59 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="P2Ni/QK9"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2607:f8b0:4864:20::529 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5bdbe2de25fso1288187a12.3; Thu, 25 Apr 2024 20:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714103698; x=1714708498; 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=86u60VKFb3IeAn4rEu2lsP300cn28bVv1LXnzRBlL0s=; b=P2Ni/QK9UKPv+FUNjhEsaazZIeYTDZnnkTzBIZC+o8HfgwgpBzbH3z6X/iuS9c9d/O Pse8yOcrnrIMR1PfukU0Yjz1ocCLsmPzKj/2ExoFp0JfxzEGQ6/2l+pNQvOnoDgvJ9HU SF3xTjtIvhlDaFFrGDWBms6fH4HD9dZqqwx3sjSsoKol9QiT0mzzwpom5JVzzKTuOkkB qvQ8lEcmjeISuaGUxkDf+DzqRRppJzajV3FgHcNi7zVnz/scB2OPwnop/fyhSQnmjExi CFy2PCnaBzNATM+LENyoH4Y9DXmBRB3hd/N9FXYY7VFQ4PDkEZbcsfJOJz+OAcjKK1hD BkJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714103698; x=1714708498; 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=86u60VKFb3IeAn4rEu2lsP300cn28bVv1LXnzRBlL0s=; b=hizb85ri33fg5NqZyj//y1u8631+asQQLH4W3/27Wn4cwSEBzpzyAJsPxR6G2GcSHa SP4qN+yDELByAn2G1sq47V41AID/nFS++bmsW4/0GK67pse/GWBVD1oMi/877ddNaoEo Tw3dFsUL1YwQDUCfFnn0soJIDEty7Dnp+EIpTK9q+N2hOdEg6HHxvPnchB+eQn61sEjC Wt6ty3CFLvVJeFlbNQmtcWFXrF7zLSfRHJhuG82Bx363t4ZZ8f1epesu8znUQXbSjbUn iq2WKt6Yr/eYzdG2IS7zyRFunh3s5WWN+fTAG50R3Spkrg/kqpxu04kpeHzZnB9gJ4kY jxeA== X-Gm-Message-State: AOJu0YzMNYzhLutNwCY3ebKPbZHq4ujUPaBJ9/Qn2knFazgSHkJX6qDA FcCgMhncbnTUZkyIgnxZ+K+xQN4KYGNIPHtjXys6V1HCigeJe5Q6O5FCPq2YVtq3KvjRxPEGvds t3pGoZP+zLSK7jf/gJgJm1YWaLcWV X-Google-Smtp-Source: AGHT+IGX4r6/r4Ozson+07nG2T1vU4CVecLDl7rICePmsCj6x779eKhriR+vATOsig1sPCWkAetZm/IOnkudMUI6hNU= X-Received: by 2002:a05:6a21:6816:b0:1a8:e79a:2b0a with SMTP id wr22-20020a056a21681600b001a8e79a2b0amr1761200pzb.0.1714103698018; Thu, 25 Apr 2024 20:54:58 -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:54:48 -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-Spamd-Result: default: False [-2.99 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.995]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; TAGGED_FROM(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::529:from] X-Rspamd-Queue-Id: 4VQf4g5NMcz4dv1 On Thu, Apr 25, 2024 at 8:51=E2=80=AFPM Rick Macklem wrote: > > 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_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