From nobody Tue Jul 29 13:16:23 2025 X-Original-To: dev-commits-src-main@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 4brwpk0RRmz62yYv; Tue, 29 Jul 2025 13:16:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwpj5bwTz3tm8; Tue, 29 Jul 2025 13:16:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-7e169ac6009so551633985a.0; Tue, 29 Jul 2025 06:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753794987; x=1754399787; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=VEO22Z/KBo3ziKIQxnPdXVzhU7BhlGpGLTjm26K70Ts=; b=gPliyqZGhY1pXyqVlUIbQ239hFQV6pbPjjOIpSPHMC3W83RVANXjG0r2kdVvMbooAs Mab7SfGvRfxAN+fhA9fk0TEFqbJIDS+/Z0ma+kfR6TsG9NfVFPWQ6xfzYcmUm3nCnYT8 /nx8i8p0OYDkHrbN7vxkH8J+qkSKGabpqYwyzq4qaYB/zosmgAU5gKOc3RN1rjntNHzg 2Hy0i3MFYnS2rYQHjjqBHqhp8mpz2LwBfU53iWWRz49AM/xYePPrBvImUg7sDNNfQS6s lqRNc0ngI7xiwXfCuEQEt3EIIiSMYEwmq2DWkNdCIFnOPNOcK+kNHbmKxxvDRG8+EERR 0wPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753794987; x=1754399787; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VEO22Z/KBo3ziKIQxnPdXVzhU7BhlGpGLTjm26K70Ts=; b=A2TQ1uCZ62y4EONBpvK2JpMA6nSBJ8H+ZA9pYuX+q04AWNdTVi7LOcy0QRWo+eug+N R/bkw4EhNfArjnFnCRH5guPLI9gK3CsVV+ktNT9cjSvzTi+ZLs0mFW0/NIOEBVQS+msp w7V2PiHal0tq6XLlv8M0zHAxPUMDP2+yU3NKcTiKRYoSDBZ5P/bbaNU8Repi7RxvXpnr 0Ow08nwFgNjngAJfR9ZuFbuGu1MlGYy/LgR5MQ/i4T+B9JWDESI1cvmZ4ds5K7Foy8cB N1LEfJRcA5l/iRO3o4yAj8qszS17a9F3jNCWIpWfZTEAApXRWaKRLSYAORBOjWScTKVz gEIw== X-Forwarded-Encrypted: i=1; AJvYcCXX2XBWMI+yjUC/wIcP82PchsPXgG2lK46OFkvu015P+7xF+/oA3DsWMDS99ktTBzJF4LjTM3MQ4FhUbLq473gUpKCbuxI=@freebsd.org, AJvYcCXZIVafixNMsJSN+7Dkjiv3GBmIV+uKca38BueUOF9XeqJTBAHxJ6LC41OP2uVkS3dtQIZM9gALoXl0ue2mat9WiikS@freebsd.org X-Gm-Message-State: AOJu0YzIIca0mi5sQWbx8ohEy6yaGmVWcJS+dpVk3yHlWwu+qsaMiQkK Om0llQCGnZ8KWvzVrIoY4mMs1tm2eY+WyR1ffwQiGhY4N8zfkfXyeyWq X-Gm-Gg: ASbGncvABM91sFXG7EG/fNmHYu0khJpLwj/mWSiQdWtChOuQCCDaW0vX0q+rfo1hRfj 68fhVGUQR/GAslidY6bSI9CRkWQgw2iQ1Bb7jO/AFNDMwKOgtMAf+atLuXr9fh1Mwz0gCiQONpt bHtF2wNc2LjM5GnjAWujBKwB7vVeI3o95XUsNKIT9Ne6GKwttFeX+aT3uy3JzutQ0NPx5YUE7f6 0MIuR4MjAE1XjaYnCFf8hoB8LNWlBgnnr9CDbPGpRX2ARCj2uN0wCN7zjUqPHX+/YPYvB9PdZ3D HlVHi6UHCyqWRwOjho7SM3YRG3I/kQNI5vGyA2gCkUbZLBUyMquEU2YNoqvUiBuypgCVarqrZvr 7G7U96mkF/zLJcPEoumhWnLTQCL/YzKZ7xUrl X-Google-Smtp-Source: AGHT+IHGLLPfDiszZbihtdUysKDFyb2CaEc343R3x8byn0AqlVUnZVBn4FE2k8brGd67SiPa0JH/Yg== X-Received: by 2002:a05:620a:aa09:b0:7e3:2f18:e2aa with SMTP id af79cd13be357-7e63bf60f5cmr2052114685a.25.1753794987353; Tue, 29 Jul 2025 06:16:27 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e6438a144bsm417895885a.81.2025.07.29.06.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 06:16:26 -0700 (PDT) Date: Tue, 29 Jul 2025 09:16:23 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4brwpj5bwTz3tm8 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)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > Author: Konstantin Belousov > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > ufs_vnops.c: newparent is not bool > > > > > > Use proper comparision operators when we need to see if newparent was > > > set to not-zero value. > > > > > > Reviewed by: mckusick, olce > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D51573 > > > --- > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > index 406b8f943077..2757fb066981 100644 > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > @@ -1476,7 +1476,7 @@ relock: > > > * the user must have write permission in the source so > > > * as to be able to change "..". > > > */ > > > - if (doingdirectory && newparent) { > > > + if (doingdirectory && newparent != 0) { > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > if (error) > > > goto unlockout; > > > @@ -1539,7 +1539,7 @@ relock: > > > if (tip == NULL) { > > > if (ITODEV(tdp) != ITODEV(fip)) > > > panic("ufs_rename: EXDEV"); > > > - if (doingdirectory && newparent) { > > > + if (doingdirectory && newparent != 0) { > > > /* > > > * Account for ".." in new directory. > > > * When source and destination have the same > > > @@ -1632,7 +1632,7 @@ relock: > > > goto bad; > > > } > > > if (doingdirectory) { > > > - if (!newparent) { > > > + if (newparent == 0) { > > > tdp->i_effnlink--; > > > if (DOINGSOFTDEP(tdvp)) > > > softdep_change_linkcnt(tdp); > > > @@ -1642,11 +1642,10 @@ relock: > > > softdep_change_linkcnt(tip); > > > } > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > - IFTODT(fip->i_mode), > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > + IFTODT(fip->i_mode), doingdirectory); > > > > Is this part of the change correct? > > > > syzbot is reporting some panics after this change and commit > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > I committed the revert, with the Fixes tag, for now. But consider: > > Two cases: > 1. doingdirectory == true: > the expression can be rewritten as newparent ? newparent : true. > Then this is the same as true. > > 2. doingdirectory == false: > then the expression is false. I think the problem is that the isrmdir parameter to ufs_dirrewrite() is not a bool as the name implies. See softdep_setup_directory_change(), which checks isrmdir > 1.