From nobody Tue Jul 29 12:26:52 2025 X-Original-To: dev-commits-src-all@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 4brvjg57s0z62vKh; Tue, 29 Jul 2025 12:27:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 4brvjg1Ytlz3jDm; Tue, 29 Jul 2025 12:27:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-7e344e0212eso81333585a.0; Tue, 29 Jul 2025 05:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753792017; x=1754396817; 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=bYL8MinZma1FaL9ZElNdYOL9zvc2IzZ9hrXyWQ9YRnc=; b=U8Km6HxB+cSfpo/WBH7ZBnvymJTued2ASFdsfAQcSd5EAoAxbb6MKNa87wbjwj1/G5 0AYg/wIKP/nWNQJSj2q0B1dlgpYgMK8vq5BzvMVdZnKFX+zHQR2B2xaOc0IdYp+J/NuO IhYnQULSxvrtVf1qwrUZvDg70b8XkFUkuwzAFSaWLhzbTowzDgki0CERPy7AAQDTQFnO Xn9Y3L8afyHobsrDR9UKn3bbfdfHA5RGwVXk3a4B2xHbq5uT6EmOi7i5msncyYFlPZK3 sjxZeAcaD6NloTeGN3jlEIuKWC0nJG46ExaCgNT45VgyCoNiROUj8jzSuNQYr830ZN45 yYBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753792017; x=1754396817; 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=bYL8MinZma1FaL9ZElNdYOL9zvc2IzZ9hrXyWQ9YRnc=; b=Ku0dryXHNc1vAMbmiF7coUcl0zQkYrzBypPfFO/+FoceHlG+aOzS5kaznj7JfdLk4b jC37v7AMqlu16GhRcyqNh0ubj6dPJYQhC9hqVa8Rn1CpTvXlyP4tA6IFrK4nRu4sQFfb FMEm9+OxrJEEVdaQf3QHZ25lRWnn+ul2vK/eMhKcTVV5SstvsahWTzQdY9H2lYgb67Sz Q0ZeorkEr63j9rihXFYddDpQGCKBvYr5BnHqe9rk2w5XUzLGX/A670i3zvGyc1MGBkFf nF4/6g7PEXSKvPi1e3Ol68C72Bn6cjfM+4VND6MKyoZ2oc+cYjGfZWj601w1UP8or2nw fBaQ== X-Forwarded-Encrypted: i=1; AJvYcCUeNfYkNzUYjTvdfJlTVzqzvIGIoePzlZFSA/Ts5XH72d6x7svqMZgUqmt5Z5u5mKjJLDvdZfR7jCsnjYYF2nS7xlqPvqc=@freebsd.org, AJvYcCV/jI2NSVfqojA0Kh0Z02aye4v/a4TK3FgqmyJqb91B5iRxFIAdXyvWYjFsOD/JcfDTr6e+Cpy6i5vL8LZkzHI7r12I@freebsd.org X-Gm-Message-State: AOJu0YwfCmQwGPHlE+1KloYjhHV9LfwN0wKoFPGEasDy1QTBxSvHAkps Okgfj3fIqJme4kuuFS2aijbFQaxZICRgEPZ2GrIDIlLugvB61TRE975kpyQhvqho X-Gm-Gg: ASbGnct8UP38HmOIuuU4nsJkP9tuKQOkhMynVdEJXgFklqhFujQDUiAmKAdlHzyB5kQ pNdJVaGZAmXfULfUkqJpV+PiHGj5cK+SwajPbHaN5C+tfHj9mk5APOPo7y0uRapmknBRmQSWmx0 VzkjU7T4hILXcJuFITl2OfMTqLCpUsobTnvtR8Oy7wKcTpv2vsB/5PlXaqDiRwXndYYEBGzrXDL 0H0P9mWHjCED9rjrcsyqcUAOIFDyPeUKZe3jq7WwVTBxyx0hy2rtcnoqYcwjj6F4dOj5ztqG16a NC5BV7q3N8nUA+6kHOfz9V+OZWwBdcfHtWq6dNII+dKB1ZxbdAJdZSVoaXEPzsoXQbo2uHW9wwE nq9K2pr+KsYyMD+nmRmUIp5Uln5GHnmd99yIv X-Google-Smtp-Source: AGHT+IEELTq0g1zpp0jvD3hKjn+k8O5PCGnY7FfXtqgi0vvikymNKRjfnbF4HvMMQ5fnNIzY2lI9sQ== X-Received: by 2002:a05:620a:d95:b0:7e6:4f86:580d with SMTP id af79cd13be357-7e65f314cc7mr476514085a.30.1753792016359; Tue, 29 Jul 2025 05:26:56 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e668fd0d44sm21840885a.47.2025.07.29.05.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 05:26:55 -0700 (PDT) Date: Tue, 29 Jul 2025 08:26:52 -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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4brvjg1Ytlz3jDm 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 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 > if (error) { > if (doingdirectory) { > - if (!newparent) { > + if (newparent == 0) { > tdp->i_effnlink++; > if (DOINGSOFTDEP(tdvp)) > softdep_change_linkcnt(tdp); > @@ -1669,7 +1668,7 @@ relock: > * disk, so when running with that code we avoid doing > * them now. > */ > - if (!newparent) { > + if (newparent == 0) { > tdp->i_nlink--; > DIP_SET_NLINK(tdp, tdp->i_nlink); > UFS_INODE_SET_FLAG(tdp, IN_CHANGE); > @@ -1698,7 +1697,7 @@ relock: > * parent directory must be decremented > * and ".." set to point to the new parent. > */ > - if (doingdirectory && newparent) { > + if (doingdirectory && newparent != 0) { > /* > * Set the directory depth based on its new parent. > */