Re: [f2fs-dev] [PATCH v2] f2fs: fix block migration when section is not aligned to pow2

2024-05-10 Thread patchwork-bot+f2fs
Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim :

On Sun, 28 Apr 2024 21:51:42 -0600 you wrote:
> As for zoned-UFS, f2fs section size is forced to zone size. And zone
> size may not aligned to pow2.
> 
> Fixes: 859fca6b706e ("f2fs: swap: support migrating swapfile in aligned write 
> mode")
> Signed-off-by: Liao Yuanhong 
> Signed-off-by: Wu Bo 
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,v2] f2fs: fix block migration when section is not aligned to pow2
https://git.kernel.org/jaegeuk/f2fs/c/aa4074e8fec4

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v2] f2fs: fix block migration when section is not aligned to pow2

2024-04-29 Thread Chao Yu

On 2024/4/29 11:51, Wu Bo wrote:

As for zoned-UFS, f2fs section size is forced to zone size. And zone
size may not aligned to pow2.

Fixes: 859fca6b706e ("f2fs: swap: support migrating swapfile in aligned write 
mode")
Signed-off-by: Liao Yuanhong 
Signed-off-by: Wu Bo 


Reviewed-by: Chao Yu 

Thanks,


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH v2] f2fs: fix block migration when section is not aligned to pow2

2024-04-28 Thread Wu Bo via Linux-f2fs-devel
As for zoned-UFS, f2fs section size is forced to zone size. And zone
size may not aligned to pow2.

Fixes: 859fca6b706e ("f2fs: swap: support migrating swapfile in aligned write 
mode")
Signed-off-by: Liao Yuanhong 
Signed-off-by: Wu Bo 
---
v2:
Fix arch-i386 build error.
https://lore.kernel.org/oe-kbuild-all/202404290041.jfis3zkw-...@intel.com/
---
 fs/f2fs/data.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index bee1e45f76b8..6fd877c69c03 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3916,15 +3916,14 @@ static int check_swap_activate(struct swap_info_struct 
*sis,
struct address_space *mapping = swap_file->f_mapping;
struct inode *inode = mapping->host;
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
-   sector_t cur_lblock;
-   sector_t last_lblock;
-   sector_t pblock;
-   sector_t lowest_pblock = -1;
-   sector_t highest_pblock = 0;
+   block_t cur_lblock;
+   block_t last_lblock;
+   block_t pblock;
+   block_t lowest_pblock = -1;
+   block_t highest_pblock = 0;
int nr_extents = 0;
-   unsigned long nr_pblocks;
+   unsigned int nr_pblocks;
unsigned int blks_per_sec = BLKS_PER_SEC(sbi);
-   unsigned int sec_blks_mask = BLKS_PER_SEC(sbi) - 1;
unsigned int not_aligned = 0;
int ret = 0;
 
@@ -3962,8 +3961,8 @@ static int check_swap_activate(struct swap_info_struct 
*sis,
pblock = map.m_pblk;
nr_pblocks = map.m_len;
 
-   if ((pblock - SM_I(sbi)->main_blkaddr) & sec_blks_mask ||
-   nr_pblocks & sec_blks_mask ||
+   if ((pblock - SM_I(sbi)->main_blkaddr) % blks_per_sec ||
+   nr_pblocks % blks_per_sec ||
!f2fs_valid_pinned_area(sbi, pblock)) {
bool last_extent = false;
 
-- 
2.25.1



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel