From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796296092; b=SIiYBKtlG/vB/882C5ewa7EfXhS18JjgLytHSGZ4VIoI0Or5ZEUs2y/v1kq0jFKzE/CE +RPf2p6xlRe5wSjg8D2siDzjuaGAw1Q+Q1GdTnf0GEArZ/4fXKepWTsY6E7PRog4QEPjV nhHU6Nm7uwgwxrAOLtVgk9bVFJPgJcczAtnfKSXRe/4A8VkiNGYjX2ztZf+BlJ9JiP646 serITJ4VQhBxo7MZKOvvLP85M0tl1kru0Rq8kPT3kUmz2i1FnT4jaqlnUGipZw6Ujz8vg 0DaJOw0h+ewWOx7T3BgdkQsEnWXJy8V1aChP6TYpV5Dr2GAi/T2LOh3L+gcBfdtDpNg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796296092; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=nsokLc2YVlJKYZtIkOrCY+oNwdvHOlLLs1G99VjEKQc=; b=Zz71i1EBEh1/sRumS3TQkulJHD42OPoyu1arbOAtUkwXY+jidySsE00aDtO/SgMDnGRK 5Bj8ndjKp3I/E5i4zmnJoac0ctUB5+4Wbm4lLRWJQ4gYUBdyGObhDf6eWL7A4UMjWlveZ mZ5sSFmAlkS3j7ClF8pePgZ+1v4x9w5cZFtV9TFN461jq5E8DB34L2PPKYF2bPe5DwWdF ndqYWripZnJLP7hr/1t+3PrF7ce7gkK7rF8veft6xILp9NVrE+WZhVdWICoX7AiTzE6tb X9FwVzYR5fAEdsDrBUCii1+w8oWbe9t4PCvO6Uep6DHOZZuWTOF7aczOJmrDAuL+2Mg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="TKJm4/l7"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F7A7606A32D for ; Thu, 3 Dec 2026 11:08:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TKJm4/l7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B6031F000C1; Thu, 3 Dec 2026 11:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796296092; bh=nsokLc2YVlJKYZtIkOrCY+oNwdvHOlLLs1G99VjEKQc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=TKJm4/l7925I01OlnHlyFVK5HidcJvP2bd5H+4Wa94SzYZVknTMBPkKmKi3o9kp0I 8d2NHBvE7ItE9kLjAq/nA++XDk2VIhg3i9Rs/jlkiEdGl5ovgUwwaWMC2MI4/8heZF i24czuwC2atNHwxxaEoYcshddOAeEg6mDzffJ+uZnVAlDmZjfPMXDnxULq2WJoY95K We2vMNz0g6/aL47N0m32aoUrxXRkKN3/5kGbHdynxFBQOMj4PqNhTpXlaflBl1uRuj prn42drRciQ+WZjpI91zWLb0ty4Po2+uF1xnSDKhWLDoRr0V/z56+SqlHScUOtrV9x NjPkp5XBoAOiw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] generic: test that insert range respects RLIMIT_FSIZE Reply-To: sashiko-reviews@lists.linux.dev To: "Ding Feng" Cc: linux-ext4@vger.kernel.org, tytso@mit.edu In-Reply-To: <20261203105330.65937-1-dingf3ng@gmail.com> References: <20261203105330.65937-1-dingf3ng@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 11:08:11 +0000 X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] generic/810: insert_under_limit() truncates ulimit -f for non-KiB unit sizes - [Low] fstests: missing _cleanup() in generic/810 leaves TEST_DIR file -- commit cf8171da3dc9f8ba5bc63d270ae5caa9e2305ada Author: Ding Feng generic: test that insert range respects RLIMIT_FSIZE This commit adds fstest generic/810 to verify that FALLOC_FL_INSERT_RANGE fails with EFBIG when the resulting file size would exceed RLIMIT_FSIZE and succeeds when within the limit. > diff --git a/tests/generic/810 b/tests/generic/810 > new file mode 100755 > index 0000000000000..25f5ece4210b1 > --- /dev/null > +++ b/tests/generic/810 > @@ -0,0 +1,46 @@ [ ... ] > +. ./common/preamble > +_begin_fstest auto quick insert prealloc > + > +_fixed_by_fs_commit ext4 xxxxxxxxxxxx \ > + "ext4: check RLIMIT_FSIZE in insert range" > + > +_require_test > +_require_xfs_io_command "finsert" > + > +file=3D$TEST_DIR/$seq.file [Severity: Low] Does this leave $TEST_DIR/$seq.file behind after the test finishes? common/preamble's default _cleanup() only removes $tmp.*, and this test only removes $file during setup, so it remains on TEST_DIR after exit or failure. Overriding _cleanup() to also remove $file would keep TEST_DIR clean. > + > +# Insert range works in whole file blocks, and ulimit -f in 1 KiB units. > +unit=3D$(_get_file_block_size $TEST_DIR) > +[ $unit -lt 4096 ] && unit=3D4096 > + > +# Run "finsert 0 $unit" on $file under an FSIZE limit of $1 units. SIGX= FSZ is > +# ignored so that the call fails with EFBIG instead of killing xfs_io. > +insert_under_limit() > +{ > + bash -c "ulimit -f $(($1 * unit / 1024)); trap '' SIGXFSZ; \ > + $XFS_IO_PROG -c 'finsert 0 $unit' $file" > + echo "size: $(($(stat -c %s $file) / unit)) units" > +} [Severity: Low] Can ulimit -f $(($1 * unit / 1024)) truncate below $1 * unit and cause the 3-unit insert to fail with EFBIG? On an XFS v4 filesystem with 512-byte blocks and an odd realtime extent size (such as 9 blocks, or 4608 bytes), _get_file_block_size returns a value over 4096 that is not a multiple of 1024. insert_under_limit 3 then sets RLIMIT_FSIZE to 13 KiB (13312 bytes) for a 13824-byte target size. Doubling unit when unit % 1024 is non-zero preserves allocation-unit alignment while making $1 * unit an exact multiple of 1024. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203105330.6593= 7-1-dingf3ng@gmail.com?part=3D1