diff --git a/include/kernel-5.10 b/include/kernel-5.10 index f89afc580..ba95f3f06 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .221 -LINUX_KERNEL_HASH-5.10.221 = da1dd47febac4f7856654038a47703666da3afba348b8e96e39584e0972e2725 +LINUX_VERSION-5.10 = .231 +LINUX_KERNEL_HASH-5.10.231 = 565a4883cc460af9f338966fca51a84bcba13dc7e47a563e32639115cba79675 diff --git a/target/linux/generic/files-5.10/fs/ntfs3/bitmap.c b/target/linux/generic/files-5.10/fs/ntfs3/bitmap.c index aa1844075..3f7168fd8 100644 --- a/target/linux/generic/files-5.10/fs/ntfs3/bitmap.c +++ b/target/linux/generic/files-5.10/fs/ntfs3/bitmap.c @@ -661,7 +661,7 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits) wnd->total_zeroes = nbits; wnd->extent_max = MINUS_ONE_T; wnd->zone_bit = wnd->zone_end = 0; - wnd->nwnd = bytes_to_block(sb, bitmap_size(nbits)); + wnd->nwnd = bytes_to_block(sb, ntfs3_bitmap_size(nbits)); wnd->bits_last = nbits & (wbits - 1); if (!wnd->bits_last) wnd->bits_last = wbits; @@ -1323,7 +1323,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits) return -EINVAL; /* Align to 8 byte boundary. */ - new_wnd = bytes_to_block(sb, bitmap_size(new_bits)); + new_wnd = bytes_to_block(sb, ntfs3_bitmap_size(new_bits)); new_last = new_bits & (wbits - 1); if (!new_last) new_last = wbits; diff --git a/target/linux/generic/files-5.10/fs/ntfs3/fsntfs.c b/target/linux/generic/files-5.10/fs/ntfs3/fsntfs.c index 6d02b2ce8..0089f448f 100644 --- a/target/linux/generic/files-5.10/fs/ntfs3/fsntfs.c +++ b/target/linux/generic/files-5.10/fs/ntfs3/fsntfs.c @@ -493,7 +493,7 @@ static int ntfs_extend_mft(struct ntfs_sb_info *sbi) ni->mi.dirty = true; /* Step 2: Resize $MFT::BITMAP. */ - new_bitmap_bytes = bitmap_size(new_mft_total); + new_bitmap_bytes = ntfs3_bitmap_size(new_mft_total); err = attr_set_size(ni, ATTR_BITMAP, NULL, 0, &sbi->mft.bitmap.run, new_bitmap_bytes, &new_bitmap_bytes, true, NULL); diff --git a/target/linux/generic/files-5.10/fs/ntfs3/index.c b/target/linux/generic/files-5.10/fs/ntfs3/index.c index 6f81e3a49..3e736664c 100644 --- a/target/linux/generic/files-5.10/fs/ntfs3/index.c +++ b/target/linux/generic/files-5.10/fs/ntfs3/index.c @@ -1360,8 +1360,8 @@ static int indx_create_allocate(struct ntfs_index *indx, struct ntfs_inode *ni, alloc->nres.valid_size = alloc->nres.data_size = cpu_to_le64(data_size); - err = ni_insert_resident(ni, bitmap_size(1), ATTR_BITMAP, in->name, - in->name_len, &bitmap, NULL, NULL); + err = ni_insert_resident(ni, ntfs3_bitmap_size(1), ATTR_BITMAP, + in->name, in->name_len, &bitmap, NULL, NULL); if (err) goto out2; @@ -1422,8 +1422,9 @@ static int indx_add_allocate(struct ntfs_index *indx, struct ntfs_inode *ni, if (bmp) { /* Increase bitmap. */ err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len, - &indx->bitmap_run, bitmap_size(bit + 1), - NULL, true, NULL); + &indx->bitmap_run, + ntfs3_bitmap_size(bit + 1), NULL, true, + NULL); if (err) goto out1; } @@ -1980,7 +1981,7 @@ static int indx_shrink(struct ntfs_index *indx, struct ntfs_inode *ni, if (err) return err; - bpb = bitmap_size(bit); + bpb = ntfs3_bitmap_size(bit); if (bpb * 8 == nbits) return 0; diff --git a/target/linux/generic/files-5.10/fs/ntfs3/ntfs_fs.h b/target/linux/generic/files-5.10/fs/ntfs3/ntfs_fs.h index d9d01ce03..0b11fcfa1 100644 --- a/target/linux/generic/files-5.10/fs/ntfs3/ntfs_fs.h +++ b/target/linux/generic/files-5.10/fs/ntfs3/ntfs_fs.h @@ -38,6 +38,7 @@ struct page; struct writeback_control; enum utf16_endian; +#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(u64)) #define MINUS_ONE_T ((size_t)(-1)) /* Biggest MFT / smallest cluster */ @@ -943,9 +944,9 @@ static inline bool run_is_empty(struct runs_tree *run) } /* NTFS uses quad aligned bitmaps. */ -static inline size_t bitmap_size(size_t bits) +static inline size_t ntfs3_bitmap_size(size_t bits) { - return ALIGN((bits + 7) >> 3, 8); + return BITS_TO_U64(bits) * sizeof(u64); } #define _100ns2seconds 10000000 diff --git a/target/linux/generic/files-5.10/fs/ntfs3/super.c b/target/linux/generic/files-5.10/fs/ntfs3/super.c index 97cfd3fde..4b6d57ef0 100644 --- a/target/linux/generic/files-5.10/fs/ntfs3/super.c +++ b/target/linux/generic/files-5.10/fs/ntfs3/super.c @@ -1095,7 +1095,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc) /* Check bitmap boundary. */ tt = sbi->used.bitmap.nbits; - if (inode->i_size < bitmap_size(tt)) { + if (inode->i_size < ntfs3_bitmap_size(tt)) { err = -EINVAL; goto put_inode_out; }