From patchwork Mon Jun 17 15:41:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13700989 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DBD213BAFB for ; Mon, 17 Jun 2024 15:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718638926; cv=none; b=MILeb8NIykeMlPZQAGDo/2g/BOd2LkcW66kFsrWvE2sNE1OkerKXpbNalNthngq05DVtyhOm5KbjUZGYQXoLFPmH6JXFcwuyUDeNLb9ev22QvZXHuRL9EwDS8l3lkQ7Ps4QigpOfz1CnB3zBbmt8kMIkVfjcMiFUBFFyOxFRiEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718638926; c=relaxed/simple; bh=RfgQfL5LXIUDoL/qFXgEgoM8jiMTiLhJ72mXm5gMEBw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D/6prDWDOzYVlBuk9efEdLi/V7/vlPNOXu4f9tKcKknC6aKExtXlZgJTgfDw490EKC9N+lI1OZPuL7E9g3Ww20GaNEwx+BE+PciEwiXpeIIi9moi1XRctgY43F4ElOuBrO4UrBRPCuBE/xz6hy1aJR6BAlSDlG7Qn8yI8hXDYTo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=fnUTT+0P; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=extEB2/G; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="fnUTT+0P"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="extEB2/G" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A1371383B7; Mon, 17 Jun 2024 15:42:01 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j0tObAiDF1uvHjxKzyBFYGOWCeIlG2rs85ONhpLMRkw=; b=fnUTT+0PHY/e6DBgmtBWl/6m4eSOvdj2iM6+LuiMNBRL8ofwdzwb00vHXirkFwi46kdS9c 6ZDOZlUfXtVBkx0yTTZZ6pUD/3Q4dLRkbZSoZXAI6cOjEccGn/cHZ6/5BdP1+Aqv97dnVy YOxTPfvytT3yDf/cnPCidV0eW2Ep0tc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j0tObAiDF1uvHjxKzyBFYGOWCeIlG2rs85ONhpLMRkw=; b=extEB2/GeF2JEOHmmLYvbFNKZ6KmhOF7L3oaQYlcSJjjGve5BgdXSWyfDcOJ9/ebEgqIqX fcBwFOziT7eooxBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 952B913AAA; Mon, 17 Jun 2024 15:42:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id U4bdI0lZcGYicAAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 15:42:01 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 34E50A088A; Mon, 17 Jun 2024 17:42:01 +0200 (CEST) From: Jan Kara To: Cc: Jan Kara , syzbot+d31185aa54170f7fc1f5@syzkaller.appspotmail.com Subject: [PATCH 1/3] udf: Fix bogus checksum computation in udf_rename() Date: Mon, 17 Jun 2024 17:41:51 +0200 Message-Id: <20240617154201.29512-1-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240617154024.22295-1-jack@suse.cz> References: <20240617154024.22295-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1469; i=jack@suse.cz; h=from:subject; bh=RfgQfL5LXIUDoL/qFXgEgoM8jiMTiLhJ72mXm5gMEBw=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBmcFk+M6D44/2X2mQSnUz8ABuCZLf62UCy0K/rCAk2 1fp4hO2JATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZnBZPgAKCRCcnaoHP2RA2RetCA CXbOgDjBJ3+WoSurA+latqveQHHhlvjX0zpwPf8dhIoFX5fxi6n4G/x0uZCPqUhw61h1FZl0CJcjJP f/Ct+0jR+mEgRdjtYIzGXbw5MIFDAhVT1TniVxfF0HH7PV+OP7dY6tViYDnm9WGKMYQc4FOt5gsn1f YHkrYqaBibGsSUWme6c0A5ZE18ef9Hxt2P/5LXo9DtKx1DjoV5WU4oabdLyp+Oq2i9eV4ZEE1lNv4D WdPI8mcSHbl7VWLyl5eoVeIJ8X35ZrBMZLiR/UEWXl9bUvAE7t9x7ui9r34RNF5Mh6qStv6qKbiYoY +txdZ8i9Ty6te7YhVqCte31mXrlGXG X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: A1371383B7 X-Rspamd-Action: no action X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[d31185aa54170f7fc1f5] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Syzbot reports uninitialized memory access in udf_rename() when updating checksum of '..' directory entry of a moved directory. This is indeed true as we pass on-stack diriter.fi to the udf_update_tag() and because that has only struct fileIdentDesc included in it and not the impUse or name fields, the checksumming function is going to checksum random stack contents beyond the end of the structure. This is actually harmless because the following udf_fiiter_write_fi() will recompute the checksum from on-disk buffers where everything is properly included. So all that is needed is just removing the bogus calculation. Fixes: e9109a92d2a9 ("udf: Convert udf_rename() to new directory iteration code") Link: https://lore.kernel.org/all/000000000000cf405f060d8f75a9@google.com/T/ Reported-by: syzbot+d31185aa54170f7fc1f5@syzkaller.appspotmail.com Signed-off-by: Jan Kara --- fs/udf/namei.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 1308109fd42d..78a603129dd5 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -876,8 +876,6 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (has_diriter) { diriter.fi.icb.extLocation = cpu_to_lelb(UDF_I(new_dir)->i_location); - udf_update_tag((char *)&diriter.fi, - udf_dir_entry_len(&diriter.fi)); udf_fiiter_write_fi(&diriter, NULL); udf_fiiter_release(&diriter); } From patchwork Mon Jun 17 15:41:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13700988 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DB8B13A409; Mon, 17 Jun 2024 15:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718638925; cv=none; b=Sc0HApc/Yj2yO5gHErZ11JtKm8b7JF+mVBUHM2hsWnjEO9SwVcnbvQ+9SJ1EyWUNRbeNVgCsB4Dd1lPbZisW2Wut+mMsq+Sq+2sKdxOhNZIqJykfb6/ROFoHYfr8+Bx7SKaG6tnEZ7J92p3vWBhtPdV4EUuWEGgyqej0np5N99I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718638925; c=relaxed/simple; bh=VmEnMsRb5zoPMY186ov1+GegGp8bDkrgGeHd14mjkws=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nSEeg8tVJluw3gGE55Z40ytX5CMiheRNkVXTJpZoCGZaDXNsnUhkU+KYADTTt7k1tUWOZWbZNkAsX2tPaRfRTRYbY+B8ELwuDxUe5KwLeiRsvIudgzwQXV6m20u25KG6c8jxccKgkLHs9v3oZbCOeGJIZfG7lHEJNx0DBA6Kw8k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=1Q7SZjLV; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Y8Vb1TDb; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="1Q7SZjLV"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Y8Vb1TDb" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AA4E7383B8; Mon, 17 Jun 2024 15:42:01 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I4szfb1pB4BrQDCmfE8z1lzoBTq1uzIk/Uwihz/qiLI=; b=1Q7SZjLVKu15nDRXs3B74Jmd584tBTdPS30niA58Pzl9qXItU1OmmDQYYUUuLtEW+8ARw/ 4/o/q5X6btbO3fbHJHrhoOEyL94r9BLRZbTmc2UFd9MsS61nb+oAdnCTZrrr2anuDHMnxc m7LtlmFGt4/WUQJGuEe3PRivAKWuECE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I4szfb1pB4BrQDCmfE8z1lzoBTq1uzIk/Uwihz/qiLI=; b=Y8Vb1TDb8D1LBs8h69i+UsOvk62S6xS+jflPo3KHW7LwAScpQIqbc8dXCmAiuYUxaIR70z 5Ij1Ikd4Ua0QI1CQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9B64813AC0; Mon, 17 Jun 2024 15:42:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id exwkJklZcGYpcAAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 15:42:01 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 3C586A088B; Mon, 17 Jun 2024 17:42:01 +0200 (CEST) From: Jan Kara To: Cc: Jan Kara , syzbot+5f682cd029581f9edfd1@syzkaller.appspotmail.com, stable@vger.kernel.org Subject: [PATCH 2/3] udf: Avoid using corrupted block bitmap buffer Date: Mon, 17 Jun 2024 17:41:52 +0200 Message-Id: <20240617154201.29512-2-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240617154024.22295-1-jack@suse.cz> References: <20240617154024.22295-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1778; i=jack@suse.cz; h=from:subject; bh=VmEnMsRb5zoPMY186ov1+GegGp8bDkrgGeHd14mjkws=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBmcFk/gsT55Q1HIC05YIi1G6JBlP8pIoyL6wO3s5+I v5kuulaJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZnBZPwAKCRCcnaoHP2RA2drOCA Cmcpu2JCwA8hplcTt0bV40ALC0DKIL2ycbs3ojsycTu4g6p5NwitQTXJ5wEGOESxqmZuhGTn3vf6MW sTw661F2SRY+RDSxQ1xw5/kvVSIn6YvzZ0DU5hrI1F+XVJyt89q5YX68Au5Jb7psk17ITTDjNmKnvW InYxqSYmWYYCLQAqkovsmawYt/ALMh3omPHmQ2MO5TSsRo018dsEO1hHHrPwByJJLNNBTI21TMsqvP IsR7aczccezjJPAYioXmrJf2wZfHcZLHHglSZ2IViwH/MrSBOFp1DuNosMbw8anpMol96CN3fzokvG kI2J4MtWIHmrjTFRXZC8/kkimzXQKJ X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[5f682cd029581f9edfd1] X-Rspamd-Queue-Id: AA4E7383B8 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: When the filesystem block bitmap is corrupted, we detect the corruption while loading the bitmap and fail the allocation with error. However the next allocation from the same bitmap will notice the bitmap buffer is already loaded and tries to allocate from the bitmap with mixed results (depending on the exact nature of the bitmap corruption). Fix the problem by using BH_verified bit to indicate whether the bitmap is valid or not. Reported-by: syzbot+5f682cd029581f9edfd1@syzkaller.appspotmail.com CC: stable@vger.kernel.org Fixes: 1e0d4adf17e7 ("udf: Check consistency of Space Bitmap Descriptor") Signed-off-by: Jan Kara --- fs/udf/balloc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index ab3ffc355949..558ad046972a 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -64,8 +64,12 @@ static int read_block_bitmap(struct super_block *sb, } for (i = 0; i < count; i++) - if (udf_test_bit(i + off, bh->b_data)) + if (udf_test_bit(i + off, bh->b_data)) { + bitmap->s_block_bitmap[bitmap_nr] = + ERR_PTR(-EFSCORRUPTED); + brelse(bh); return -EFSCORRUPTED; + } return 0; } @@ -81,8 +85,15 @@ static int __load_block_bitmap(struct super_block *sb, block_group, nr_groups); } - if (bitmap->s_block_bitmap[block_group]) + if (bitmap->s_block_bitmap[block_group]) { + /* + * The bitmap failed verification in the past. No point in + * trying again. + */ + if (IS_ERR(bitmap->s_block_bitmap[block_group])) + return PTR_ERR(bitmap->s_block_bitmap[block_group]); return block_group; + } retval = read_block_bitmap(sb, bitmap, block_group, block_group); if (retval < 0) From patchwork Mon Jun 17 15:41:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13700987 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EE116A33A for ; Mon, 17 Jun 2024 15:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718638925; cv=none; b=JphGk+NDHgnlNQDMtdiPbNhygx6kU3wWa95AML0buuZETzENssKxbLCdJyFqdwccSj7RzLY3PzU6bAiOUNCTGvu6DlblwkO7Igsd8Ih1d2HqdzLaj1yVHJsQAWQ46W9wL1YL3YYvTG+DMcD+P/bWby4St1Ivr1Vkab0RZ1zpKcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718638925; c=relaxed/simple; bh=Y+nNtCB7xLtYkMRjcmtchfkCbsoWb1OISgNYktgpSTc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ao3R8bnX7nbtRJ9D6yedHbEN2i+CVJS4Lnvp2l5Ap5+3an4ef8uyoQZR14l46k2Avw1J9L2ZZcyTxk9eMUwJDkkPmEJiPtZfAETwj7v+gqAtM2AOFq3kSiPk7IfT1kxqQHTKiarKaolM5XPXlvR24pI1gKzudrJ74pHH3gDpc+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=aJI8BvE3; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=0w42aqn4; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=aJI8BvE3; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=0w42aqn4; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="aJI8BvE3"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="0w42aqn4"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="aJI8BvE3"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="0w42aqn4" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AED60602F0; Mon, 17 Jun 2024 15:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NeD1YV4rpleWyejUzwtT2uBg5F5uH7warSFW/H/jmlU=; b=aJI8BvE3IPrbDbW9a6r4OJhhHb7yzCn2yZl7YyLgZZxAVOKgLlq54bXZSMmzWMEgQmvSDg 26E9S29WiHIWapPmQYwr0LE/AV7oX2DO5X+OpDPN9WMSLiXm6cuwy1mFWedZ6VwPR1q3HF 13OqdHN7lsu+SDkGCRNB+h6opbxd2GI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NeD1YV4rpleWyejUzwtT2uBg5F5uH7warSFW/H/jmlU=; b=0w42aqn4Webu256U7R0IXkUo9QY8Ef9oNewGjVHeqirB7x5qdhWziSh+EQ/1qkZ9XkHWFX Lo7XPRImixbHk0BQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NeD1YV4rpleWyejUzwtT2uBg5F5uH7warSFW/H/jmlU=; b=aJI8BvE3IPrbDbW9a6r4OJhhHb7yzCn2yZl7YyLgZZxAVOKgLlq54bXZSMmzWMEgQmvSDg 26E9S29WiHIWapPmQYwr0LE/AV7oX2DO5X+OpDPN9WMSLiXm6cuwy1mFWedZ6VwPR1q3HF 13OqdHN7lsu+SDkGCRNB+h6opbxd2GI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718638921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NeD1YV4rpleWyejUzwtT2uBg5F5uH7warSFW/H/jmlU=; b=0w42aqn4Webu256U7R0IXkUo9QY8Ef9oNewGjVHeqirB7x5qdhWziSh+EQ/1qkZ9XkHWFX Lo7XPRImixbHk0BQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9D3D913AC1; Mon, 17 Jun 2024 15:42:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id u6VhJklZcGYrcAAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 15:42:01 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 4341CA08A4; Mon, 17 Jun 2024 17:42:01 +0200 (CEST) From: Jan Kara To: Cc: Jan Kara Subject: [PATCH 3/3] udf: Drop load_block_bitmap() wrapper Date: Mon, 17 Jun 2024 17:41:53 +0200 Message-Id: <20240617154201.29512-3-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240617154024.22295-1-jack@suse.cz> References: <20240617154024.22295-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1423; i=jack@suse.cz; h=from:subject; bh=Y+nNtCB7xLtYkMRjcmtchfkCbsoWb1OISgNYktgpSTc=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBmcFlAmTWErxjlf++Q113MpkzJP6vdsvxf0JkvoJYH KyIj8HuJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZnBZQAAKCRCcnaoHP2RA2Sh1B/ 4+vO5/MV7ftLR53Anl6dNqOWAh2tYwSmBsm2Kkz4fjh/xr0FYgIuS4Bwca9c+wuP+XtxiwZekPAn27 tijjXefuHBuQhus3WvtJF0zcrU0pCHbvTbVd1aMxBLVSZ81QZlIvzXvkICJFA5nNhmfp6yvqhSqAK1 kuwez2DHPc7assH/6jeBuykZpEIN5eerlCOXj2w6IjwtLDCxV/bAKnTeW+IASgYmDXJ5gfu8RgAZBh zuRSMysjtTs9BtKg7giDj3oHWvxY0eXQ5GkidDZkFnRzB2lJctYu9V06fKIcs4f4rBmW+ygk8dyZ3N NZlAYdqBaYYxRlUN2pj8rRNaR7Qhjc X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Spamd-Result: default: False [-6.78 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-2.99)[99.94%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.986]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:email] X-Spam-Flag: NO X-Spam-Score: -6.78 X-Spam-Level: The wrapper is completely pointless as all the checks are already done in __load_block_bitmap(). Just drop it and rename __load_block_bitmap(). Signed-off-by: Jan Kara --- fs/udf/balloc.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index 558ad046972a..a76490b2ca19 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -73,9 +73,9 @@ static int read_block_bitmap(struct super_block *sb, return 0; } -static int __load_block_bitmap(struct super_block *sb, - struct udf_bitmap *bitmap, - unsigned int block_group) +static int load_block_bitmap(struct super_block *sb, + struct udf_bitmap *bitmap, + unsigned int block_group) { int retval = 0; int nr_groups = bitmap->s_nr_groups; @@ -102,23 +102,6 @@ static int __load_block_bitmap(struct super_block *sb, return block_group; } -static inline int load_block_bitmap(struct super_block *sb, - struct udf_bitmap *bitmap, - unsigned int block_group) -{ - int slot; - - slot = __load_block_bitmap(sb, bitmap, block_group); - - if (slot < 0) - return slot; - - if (!bitmap->s_block_bitmap[slot]) - return -EIO; - - return slot; -} - static void udf_add_free_space(struct super_block *sb, u16 partition, u32 cnt) { struct udf_sb_info *sbi = UDF_SB(sb);