From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F20F627A468; Tue, 29 Apr 2025 23:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745970664; cv=none; b=N5Z01zdBKQIgPphUAZ+KaXknZJ6p+Jc9AvJVer5CwTTOaULCVlueyYdCkH+OQHA1OFh9Gx5TloUzBGvEq0Mf+S1N9lN2w2UuSyk5vvXWlqbs2oNj2yqlnoP4S4pRc+rXjpQRESk/ZIz/f4Q9E8+0WyHGQ06nBJd9NBab758iZVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745970664; c=relaxed/simple; bh=hWNbhvRBcijb1nH7rU5gYmhKTyim5OmwVk1TauQ7sfY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jVng89TVUsxPSdPZTA383/l0M+KuJjNzejbLTujNtvUpYGOSjLmOIipVrjQNiCIcq7Aal4gXOGKxcPdijVkJSfKCaeryUONbTqlLkuvgHKGWJmBihQvnA6shlvIQHvZIoOEOpHG+Up+F1eSIs2r5O1k9sZVYhJy7qsS4a1ReacQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=svDl94Lp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="svDl94Lp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83831C4CEED; Tue, 29 Apr 2025 23:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745970663; bh=hWNbhvRBcijb1nH7rU5gYmhKTyim5OmwVk1TauQ7sfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=svDl94LpIyaErUbd5yH9AgylT8U/9qEnck925Y5JLvcX4+tFciqOdBo8RfrP65a5H vPQb3astxMMNKmrapAO4ixogvqWbPZSBoe2XYmt9R2GgWSofnIeW2kPgFtYjWSIrgi qSKn9nWJd4MMWyZp3HrL23M+SGM1+MeonFA5wCyx0FW0tHRoInKq3p51bSk70YZcrI ljkbLo6WZMNZTjMKxam7MXIy+opo0g1zvTe/nBfDpo47niRuKWNxxPEQMm2F/q9ABQ uHEjgYF/rRAkvmq6zUDR545QDbsXj5mbZlGT541bRnauYTDZGCUYRwi0rsk7BfrVAg ab7NCkoZ4j2dg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Davidlohr Bueso , Jan Kara , kdevops@lists.linux.dev, Luis Chamberlain , Christian Brauner , Sasha Levin , tytso@mit.edu, jack@suse.com, linux-ext4@vger.kernel.org Subject: [PATCH AUTOSEL 6.14 30/39] fs/jbd2: use sleeping version of __find_get_block() Date: Tue, 29 Apr 2025 19:49:57 -0400 Message-Id: <20250429235006.536648-30-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250429235006.536648-1-sashal@kernel.org> References: <20250429235006.536648-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.14.4 Content-Transfer-Encoding: 8bit From: Davidlohr Bueso [ Upstream commit f76d4c28a46a9260d85e00dafc8f46d369365d33 ] Convert to the new nonatomic flavor to benefit from potential performance benefits and adapt in the future vs migration such that semantics are kept. - jbd2_journal_revoke(): can sleep (has might_sleep() in the beginning) - jbd2_journal_cancel_revoke(): only used from do_get_write_access() and do_get_create_access() which do sleep. So can sleep. - jbd2_clear_buffer_revoked_flags() - only called from journal commit code which sleeps. So can sleep. Suggested-by: Jan Kara Reviewed-by: Jan Kara Signed-off-by: Davidlohr Bueso Link: https://kdevops.org/ext4/v6.15-rc2.html # [0] Link: https://lore.kernel.org/all/aAAEvcrmREWa1SKF@bombadil.infradead.org/ # [1] Link: https://lore.kernel.org/20250418015921.132400-6-dave@stgolabs.net Tested-by: kdevops@lists.linux.dev Reviewed-by: Luis Chamberlain Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- fs/jbd2/revoke.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index ce63d5fde9c3a..f68fc8c255f00 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c @@ -345,7 +345,8 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr, bh = bh_in; if (!bh) { - bh = __find_get_block(bdev, blocknr, journal->j_blocksize); + bh = __find_get_block_nonatomic(bdev, blocknr, + journal->j_blocksize); if (bh) BUFFER_TRACE(bh, "found on hash"); } @@ -355,7 +356,8 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr, /* If there is a different buffer_head lying around in * memory anywhere... */ - bh2 = __find_get_block(bdev, blocknr, journal->j_blocksize); + bh2 = __find_get_block_nonatomic(bdev, blocknr, + journal->j_blocksize); if (bh2) { /* ... and it has RevokeValid status... */ if (bh2 != bh && buffer_revokevalid(bh2)) @@ -466,7 +468,8 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh) * state machine will get very upset later on. */ if (need_cancel) { struct buffer_head *bh2; - bh2 = __find_get_block(bh->b_bdev, bh->b_blocknr, bh->b_size); + bh2 = __find_get_block_nonatomic(bh->b_bdev, bh->b_blocknr, + bh->b_size); if (bh2) { if (bh2 != bh) clear_buffer_revoked(bh2); @@ -495,9 +498,9 @@ void jbd2_clear_buffer_revoked_flags(journal_t *journal) struct jbd2_revoke_record_s *record; struct buffer_head *bh; record = (struct jbd2_revoke_record_s *)list_entry; - bh = __find_get_block(journal->j_fs_dev, - record->blocknr, - journal->j_blocksize); + bh = __find_get_block_nonatomic(journal->j_fs_dev, + record->blocknr, + journal->j_blocksize); if (bh) { clear_buffer_revoked(bh); __brelse(bh); -- 2.39.5