From nobody Sat Jan 14 18:37:22 2023 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 4NvRpq15XKz2sjbn; Sat, 14 Jan 2023 18:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NvRpq0c3jz466x; Sat, 14 Jan 2023 18:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673721443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UHu7bV39qPOFeDNcho17JkiQZvoKuYIhWsmcKOOVMHc=; b=a3ii4aZN9gRBEvXiixaEb/7/TjjBVcS/hoj13RCFIYfRQhj6ay+0/H/4eYAEy9r0VjF+5H t1Fq+hw0hc+ggbnPmLoZ+PneW31bXkHXNXQ19PxY4tnaKC1ttvI/ikEk/zteWeii1cy4Cy lS+zlgj0rM2qiRp2ONl6cY0EKi59dUuaw+6Yb4x/Hy8IaAqZTKyCPVqWxH+CfTuy2ghE2s m8Mtk+r4UftaI519h9hjbG9ARcR4GS6+iriq74bh5lnl1d7169XNoZE2Iestyfal4VdAFE BPsyjF7zu+uVjFmxkawR0FYyb0aFPXdUY0crW1TYl6BzwBxo6zUVeeTTANeC5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673721443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UHu7bV39qPOFeDNcho17JkiQZvoKuYIhWsmcKOOVMHc=; b=WXPYPrp7QNZ5sRG5UDWqNft143/Y7ZUr6GLe52zDvkfWSoaLD5VI6JzUZyNsGCLKw+Kggf BnjtxLIOQjXfNUZhtnT4VeyLYBjJqc58LBONdknHh2VwG7v707fBKYtalgOH9gxjlXJUAO 2oGFj2fRSf6lWjEy2Br2ApP/eY1wcHTVqF/PmQbf/B5roinvat1OERJrRV48FycCEZWwox 5Evt2dQtenA83ktLBcYwh7dfxiJ10Ih9oyLZGlMXzPm4Pwm4/ClBfzzzE5PUF1bpVJgWc4 1dHNsVOf0AxP28e5IIAJOMH3j1uPImiLFNB6hXb/L0QgetcrEPD9ZDmLetb0TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673721443; a=rsa-sha256; cv=none; b=p3j9te0gVmM6xnSvguXD8+CKqsgJ32qk24BLUv72HDcekzFCkdYa2xWoJPbM+Ewpo4qexH gi9nQtmW0oxwSmUCNUAWHWG+SQfC3ifX3GKtLR/kE5Q+FeWYIAyrq9x8Zzin6lM7GF16k8 PeKrSwDUJ+ZG4tJR/9LdG4xfOdVuNWAHtsM5mjaO7cLYnWx4dUEYX5cs6I2mVVBOCs5jYQ 6LPytronR39GyekafFnBz/+y8i8x0tSn8W89ThFeTZKlBHhT0Owd8gS3exFSWlJcVcDGWS 9saKsDhODSocmaT/akjCeksuYjQPbpbkOFHPTJq/WTFvDEVz/ro4MAepY/1Dhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NvRpp6YV5zxgM; Sat, 14 Jan 2023 18:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30EIbMvI062863; Sat, 14 Jan 2023 18:37:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30EIbMZw062862; Sat, 14 Jan 2023 18:37:22 GMT (envelope-from git) Date: Sat, 14 Jan 2023 18:37:22 GMT Message-Id: <202301141837.30EIbMZw062862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6e1eabadcb1d - main - ffs_syncvnode(): avoid a LoR for SU 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e1eabadcb1d554ab6c0ad8ce1d82f6748cc80b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6e1eabadcb1d554ab6c0ad8ce1d82f6748cc80b4 commit 6e1eabadcb1d554ab6c0ad8ce1d82f6748cc80b4 Author: Konstantin Belousov AuthorDate: 2023-01-07 12:22:18 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-14 18:28:11 +0000 ffs_syncvnode(): avoid a LoR for SU There is another case where SU code does ffs_syncvnode(dvp) for the parent directory dvp while the child vnode vp is locked. Avoid the issue by relocking and returning ERELOOKUP to indicate the need of resync. Reported by: jkim Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D37997 --- sys/ufs/ffs/ffs_softdep.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 7c9473737e68..ef1753862595 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -12758,9 +12758,15 @@ restart: pagedep_new_block = pagedep->pd_state & NEWBLOCK; FREE_LOCK(ump); locked = 0; - if (pagedep_new_block && (error = - ffs_syncvnode(pvp, MNT_WAIT, 0))) { + if (pagedep_new_block) { + VOP_UNLOCK(vp); + error = ffs_syncvnode(pvp, + MNT_WAIT, 0); + if (error == 0) + error = ERELOOKUP; vput(pvp); + vn_lock(vp, LK_EXCLUSIVE | + LK_RETRY); return (error); } }