Skip to content

Commit 056f8c4

Browse files
committed
Merge tag 'ext4_for_linus-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 updates from Ted Ts'o: "Lots of cleanups and bug fixes this cycle, primarily in the block allocation, extent management, fast commit, and journalling" * tag 'ext4_for_linus-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (93 commits) ext4: convert EXT4_B2C(sbi->s_stripe) users to EXT4_NUM_B2C ext4: check stripe size compatibility on remount as well ext4: fix i_data_sem unlock order in ext4_ind_migrate() ext4: remove the special buffer dirty handling in do_journal_get_write_access ext4: fix a potential assertion failure due to improperly dirtied buffer ext4: hoist ext4_block_write_begin and replace the __block_write_begin ext4: persist the new uptodate buffers in ext4_journalled_zero_new_buffers ext4: dax: keep orphan list before truncate overflow allocated blocks ext4: fix error message when rejecting the default hash ext4: save unnecessary indentation in ext4_ext_create_new_leaf() ext4: make some fast commit functions reuse extents path ext4: refactor ext4_swap_extents() to reuse extents path ext4: get rid of ppath in convert_initialized_extent() ext4: get rid of ppath in ext4_ext_handle_unwritten_extents() ext4: get rid of ppath in ext4_ext_convert_to_initialized() ext4: get rid of ppath in ext4_convert_unwritten_extents_endio() ext4: get rid of ppath in ext4_split_convert_extents() ext4: get rid of ppath in ext4_split_extent() ext4: get rid of ppath in ext4_force_split_extent_at() ext4: get rid of ppath in ext4_split_extent_at() ...
2 parents 171754c + ff2beee commit 056f8c4

25 files changed

+989
-994
lines changed

Documentation/admin-guide/ext4.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ When mounting an ext4 filesystem, the following option are accepted:
212212
that ext4's inode table readahead algorithm will pre-read into the
213213
buffer cache. The default value is 32 blocks.
214214

215-
nouser_xattr
216-
Disables Extended User Attributes. See the attr(5) manual page for
217-
more information about extended attributes.
218-
219-
noacl
220-
This option disables POSIX Access Control List support. If ACL support
221-
is enabled in the kernel configuration (CONFIG_EXT4_FS_POSIX_ACL), ACL
222-
is enabled by default on mount. See the acl(5) manual page for more
223-
information about acl.
224-
225215
bsddf (*)
226216
Make 'df' act like BSD.
227217

fs/ext4/bitmap.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ unsigned int ext4_count_free(char *bitmap, unsigned int numchars)
1818

1919
int ext4_inode_bitmap_csum_verify(struct super_block *sb,
2020
struct ext4_group_desc *gdp,
21-
struct buffer_head *bh, int sz)
21+
struct buffer_head *bh)
2222
{
2323
__u32 hi;
2424
__u32 provided, calculated;
2525
struct ext4_sb_info *sbi = EXT4_SB(sb);
26+
int sz;
2627

2728
if (!ext4_has_metadata_csum(sb))
2829
return 1;
2930

31+
sz = EXT4_INODES_PER_GROUP(sb) >> 3;
3032
provided = le16_to_cpu(gdp->bg_inode_bitmap_csum_lo);
3133
calculated = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz);
3234
if (sbi->s_desc_size >= EXT4_BG_INODE_BITMAP_CSUM_HI_END) {
@@ -40,14 +42,16 @@ int ext4_inode_bitmap_csum_verify(struct super_block *sb,
4042

4143
void ext4_inode_bitmap_csum_set(struct super_block *sb,
4244
struct ext4_group_desc *gdp,
43-
struct buffer_head *bh, int sz)
45+
struct buffer_head *bh)
4446
{
4547
__u32 csum;
4648
struct ext4_sb_info *sbi = EXT4_SB(sb);
49+
int sz;
4750

4851
if (!ext4_has_metadata_csum(sb))
4952
return;
5053

54+
sz = EXT4_INODES_PER_GROUP(sb) >> 3;
5155
csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz);
5256
gdp->bg_inode_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF);
5357
if (sbi->s_desc_size >= EXT4_BG_INODE_BITMAP_CSUM_HI_END)

fs/ext4/dir.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,20 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
280280
struct fscrypt_str de_name =
281281
FSTR_INIT(de->name,
282282
de->name_len);
283+
u32 hash;
284+
u32 minor_hash;
285+
286+
if (IS_CASEFOLDED(inode)) {
287+
hash = EXT4_DIRENT_HASH(de);
288+
minor_hash = EXT4_DIRENT_MINOR_HASH(de);
289+
} else {
290+
hash = 0;
291+
minor_hash = 0;
292+
}
283293

284294
/* Directory is encrypted */
285295
err = fscrypt_fname_disk_to_usr(inode,
286-
EXT4_DIRENT_HASH(de),
287-
EXT4_DIRENT_MINOR_HASH(de),
288-
&de_name, &fstr);
296+
hash, minor_hash, &de_name, &fstr);
289297
de_name = fstr;
290298
fstr.len = save_len;
291299
if (err)

fs/ext4/ext4.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ struct ext4_inode_info {
10581058

10591059
/* Number of ongoing updates on this inode */
10601060
atomic_t i_fc_updates;
1061+
atomic_t i_unwritten; /* Nr. of inflight conversions pending */
10611062

10621063
/* Fast commit wait queue for this inode */
10631064
wait_queue_head_t i_fc_wait;
@@ -1106,6 +1107,10 @@ struct ext4_inode_info {
11061107

11071108
/* mballoc */
11081109
atomic_t i_prealloc_active;
1110+
1111+
/* allocation reservation info for delalloc */
1112+
/* In case of bigalloc, this refer to clusters rather than blocks */
1113+
unsigned int i_reserved_data_blocks;
11091114
struct rb_root i_prealloc_node;
11101115
rwlock_t i_prealloc_lock;
11111116

@@ -1122,10 +1127,6 @@ struct ext4_inode_info {
11221127
/* ialloc */
11231128
ext4_group_t i_last_alloc_group;
11241129

1125-
/* allocation reservation info for delalloc */
1126-
/* In case of bigalloc, this refer to clusters rather than blocks */
1127-
unsigned int i_reserved_data_blocks;
1128-
11291130
/* pending cluster reservations for bigalloc file systems */
11301131
struct ext4_pending_tree i_pending_tree;
11311132

@@ -1149,7 +1150,6 @@ struct ext4_inode_info {
11491150
*/
11501151
struct list_head i_rsv_conversion_list;
11511152
struct work_struct i_rsv_conversion_work;
1152-
atomic_t i_unwritten; /* Nr. of inflight conversions pending */
11531153

11541154
spinlock_t i_block_reservation_lock;
11551155

@@ -2338,9 +2338,9 @@ struct ext4_dir_entry_2 {
23382338
((struct ext4_dir_entry_hash *) \
23392339
(((void *)(entry)) + \
23402340
((8 + (entry)->name_len + EXT4_DIR_ROUND) & ~EXT4_DIR_ROUND)))
2341-
#define EXT4_DIRENT_HASH(entry) le32_to_cpu(EXT4_DIRENT_HASHES(de)->hash)
2341+
#define EXT4_DIRENT_HASH(entry) le32_to_cpu(EXT4_DIRENT_HASHES(entry)->hash)
23422342
#define EXT4_DIRENT_MINOR_HASH(entry) \
2343-
le32_to_cpu(EXT4_DIRENT_HASHES(de)->minor_hash)
2343+
le32_to_cpu(EXT4_DIRENT_HASHES(entry)->minor_hash)
23442344

23452345
static inline bool ext4_hash_in_dirent(const struct inode *inode)
23462346
{
@@ -2462,6 +2462,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
24622462
#define DX_HASH_HALF_MD4_UNSIGNED 4
24632463
#define DX_HASH_TEA_UNSIGNED 5
24642464
#define DX_HASH_SIPHASH 6
2465+
#define DX_HASH_LAST DX_HASH_SIPHASH
24652466

24662467
static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
24672468
const void *address, unsigned int length)
@@ -2695,10 +2696,10 @@ struct mmpd_data {
26952696
extern unsigned int ext4_count_free(char *bitmap, unsigned numchars);
26962697
void ext4_inode_bitmap_csum_set(struct super_block *sb,
26972698
struct ext4_group_desc *gdp,
2698-
struct buffer_head *bh, int sz);
2699+
struct buffer_head *bh);
26992700
int ext4_inode_bitmap_csum_verify(struct super_block *sb,
27002701
struct ext4_group_desc *gdp,
2701-
struct buffer_head *bh, int sz);
2702+
struct buffer_head *bh);
27022703
void ext4_block_bitmap_csum_set(struct super_block *sb,
27032704
struct ext4_group_desc *gdp,
27042705
struct buffer_head *bh);
@@ -3712,11 +3713,12 @@ extern int ext4_map_blocks(handle_t *handle, struct inode *inode,
37123713
extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode,
37133714
int num,
37143715
struct ext4_ext_path *path);
3715-
extern int ext4_ext_insert_extent(handle_t *, struct inode *,
3716-
struct ext4_ext_path **,
3717-
struct ext4_extent *, int);
3716+
extern struct ext4_ext_path *ext4_ext_insert_extent(
3717+
handle_t *handle, struct inode *inode,
3718+
struct ext4_ext_path *path,
3719+
struct ext4_extent *newext, int gb_flags);
37183720
extern struct ext4_ext_path *ext4_find_extent(struct inode *, ext4_lblk_t,
3719-
struct ext4_ext_path **,
3721+
struct ext4_ext_path *,
37203722
int flags);
37213723
extern void ext4_free_ext_path(struct ext4_ext_path *);
37223724
extern int ext4_ext_check_inode(struct inode *inode);
@@ -3853,6 +3855,9 @@ static inline int ext4_buffer_uptodate(struct buffer_head *bh)
38533855
return buffer_uptodate(bh);
38543856
}
38553857

3858+
extern int ext4_block_write_begin(handle_t *handle, struct folio *folio,
3859+
loff_t pos, unsigned len,
3860+
get_block_t *get_block);
38563861
#endif /* __KERNEL__ */
38573862

38583863
#define EFSBADCRC EBADMSG /* Bad CRC detected */

0 commit comments

Comments
 (0)