From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 CD3AFDF76 for ; Thu, 6 Aug 2026 02:43:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785984181; cv=none; b=UZINuxVF7VpJ/56gahQy4skfZJJPkOq8oph5wBoXRmgHvw1ukXXMzZHR5hNaGjuKiBmTxxkShhevcS44yscXpszGOZUK4q2Vym+e0dfK4mEAUUPr4LyjyrrMGix1EeCt76dt4Nyi96JRtd1N0TRWalbduKf8zRGdSYBuYf+h+Rk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785984181; c=relaxed/simple; bh=1mO5BuVOCRsNT8YXWBk+m/uhr47PmaPiyrnJl/ci79o=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=RTzAo+XBENRAAkbh5Czzp3TDR5pxex6X6vG2ddeGn5rjhjvZ37Zg8Hc2vwz4zGJr8ZtiZyOXqq0TgKtLPU/gEo92chOFQ44Rmlp1+5O6+UKpMMboe+riFWOqFTZRHn8JFbIqyBqVNgf33hnxrMHUlubZSlmMS7TmWj/xv2fM3i4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D+tuhEgF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D+tuhEgF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 401F01F000E9; Thu, 6 Aug 2026 02:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785984180; bh=VvF43tSz7wwDuasCawSQVfqt2rfdFjc4yUPz7UYUWkI=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=D+tuhEgF1O9MbzUEk5YSkzwGdiPaUu+EMqNUbOO3/MLXIzwtS+OR55sFExFv+UUeC 9I7ZNDVeWnSXDTH7MlP40Jnmnel2cszcUvX5VX1V/ZjyjxWu45N4wDr0vWYnSaiZsN MZ3/qy7+uI6NUhyhI1KxovaHhRBWn/UfHphfCcbQP67RzRGJb9ELjNQvMINCHxEJZO +Wm2FLAM/XBPsrGdE42XPuWClihHLUHlKbJHYe0aj4JR6GlFzqFZSyF7ioOPIosctm 1Brv0ogt9xHw7zgQe/6mCJWnNIohcfTfpbM/uKRCp+8xvaqWrPI2egPIROn5dlFQEo qUPTrHqRQwcTA== Message-ID: <246b5851-2cca-4ea8-b050-3cf9e5c76917@kernel.org> Date: Thu, 6 Aug 2026 10:42:57 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH v6] f2fs: support dynamic reserve/release for device aliasing To: Daeho Jeong References: <20260730154618.2166947-1-daeho43@gmail.com> <8b643643-17d5-4c80-9548-c8dc461c9d2d@kernel.org> Content-Language: en-US From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 8/6/26 00:43, Daeho Jeong wrote: > On Tue, Aug 4, 2026 at 6:20 PM Chao Yu wrote: >> >> On 7/30/26 23:46, Daeho Jeong wrote: >>> From: Daeho Jeong >>> >>> This patch adds a dynamic management feature to the existing device >>> aliasing functionality. It allows users to dynamically reserve or >>> release specific devices from the filesystem's free pool at runtime >>> through new ioctls. >>> >>> To support this, three new ioctls are introduced: >>> - F2FS_IOC_RESERVE_DEV_ALIAS: This reclaims the space occupied by a >>> device aliasing file. It first performs a capacity check, resets GC >>> victim information for the target range, marks the segments as in-use >>> to prevent new allocations, and then triggers GC to migrate existing >>> valid data out of the range. Finally, it reserves these blocks in the >>> SIT to effectively exclude the device from the usable capacity. >>> >>> - F2FS_IOC_RELEASE_DEV_ALIAS: This releases the reserved space of a >>> previously reserved device aliasing file. It truncates the blocks >>> associated with the file, which makes them available for general >>> filesystem allocation again. >>> >>> - F2FS_IOC_GET_DEV_ALIAS_STATUS: This retrieves the current aliasing >>> status of a device aliasing file, returning whether the file is >>> released (inactive alias) or reserved (active alias, with blocks >>> fully allocated on the device). >>> >>> Signed-off-by: Daeho Jeong >> Reviewed-by: Chao Yu >> >> Thanks, > > Oh, I overlooked that ei.blk includes the segment0_blkaddr offset (the > metadata area), so `ei.blk % BLKS_PER_SEC(sbi)` incorrectly checked > alignment from block 0 rather than the segment area start. Oh, I may missed this... > > I am going to fix it using the `GET_SEGOFF_FROM_SEG0()` macro: > if ((GET_SEGOFF_FROM_SEG0(sbi, ei.blk) % BLKS_PER_SEC(sbi)) || > (ei.len % BLKS_PER_SEC(sbi))) { > ... > } Looks fine to me. Thanks, > > Thanks,