From: Bob Glossman Date: Fri, 19 May 2017 14:54:15 +0000 (-0700) Subject: LU-9539 kernel: kernel update [SLES12 SP1 3.12.74-60.64.40] X-Git-Tag: 2.9.59~18 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9f1fd53c5fd1a0982b245d2b8fb529bf7bb568f6;hp=603557c13111f188d51a1e7983343471e4a5cf71 LU-9539 kernel: kernel update [SLES12 SP1 3.12.74-60.64.40] Update target and kernel_config files for new version Test-Parameters: clientdistro=sles12 testgroup=review-ldiskfs \ mdsdistro=sles12 ossdistro=sles12 mdtfilesystemtype=ldiskfs \ ostfilesystemtype=ldiskfs Signed-off-by: Bob Glossman Change-Id: Ie0cb65603504da3b7dd38ab4962198142b1629f6 Reviewed-on: https://review.whamcloud.com/27222 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Minh Diep Reviewed-by: Oleg Drokin --- diff --git a/ldiskfs/kernel_patches/patches/sles12sp1/ext4-large-dir.patch b/ldiskfs/kernel_patches/patches/sles12sp1/ext4-large-dir.patch new file mode 100644 index 0000000..d8d60e3 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/sles12sp1/ext4-large-dir.patch @@ -0,0 +1,347 @@ +This INCOMPAT_LARGEDIR feature allows larger directories +to be created in ldiskfs, both with directory sizes over +2GB and and a maximum htree depth of 3 instead of the +current limit of 2. These features are needed in order +to exceed the current limit of approximately 10M entries +in a single directory. + +Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/ext4.h +=================================================================== +--- linux-3.10.0-229.1.2.fc21.x86_64.orig/fs/ext4/ext4.h ++++ linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/ext4.h +@@ -1585,7 +1585,8 @@ static inline void ext4_clear_state_flag + EXT4_FEATURE_INCOMPAT_EA_INODE| \ + EXT4_FEATURE_INCOMPAT_MMP | \ + EXT4_FEATURE_INCOMPAT_DIRDATA| \ +- EXT4_FEATURE_INCOMPAT_INLINE_DATA) ++ EXT4_FEATURE_INCOMPAT_INLINE_DATA| \ ++ EXT4_FEATURE_INCOMPAT_LARGEDIR) + #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ + EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ + EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \ +@@ -1999,6 +2000,9 @@ struct mmpd_data { + # define NORET_TYPE /**/ + # define ATTRIB_NORET __attribute__((noreturn)) + # define NORET_AND noreturn, ++/* htree levels for ext4 */ ++#define EXT4_HTREE_LEVEL_COMPAT 2 ++#define EXT4_HTREE_LEVEL 3 + + struct ext4_xattr_ino_array { + unsigned int xia_count; /* # of used item in the array */ +@@ -2472,13 +2476,16 @@ static inline void ext4_r_blocks_count_s + es->s_r_blocks_count_hi = cpu_to_le32(blk >> 32); + } + +-static inline loff_t ext4_isize(struct ext4_inode *raw_inode) ++static inline loff_t ext4_isize(struct super_block *sb, ++ struct ext4_inode *raw_inode) + { +- if (S_ISREG(le16_to_cpu(raw_inode->i_mode))) ++ if (S_ISREG(le16_to_cpu(raw_inode->i_mode)) || ++ (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_LARGEDIR) && ++ S_ISDIR(le16_to_cpu(raw_inode->i_mode)))) + return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) | + le32_to_cpu(raw_inode->i_size_lo); +- else +- return (loff_t) le32_to_cpu(raw_inode->i_size_lo); ++ ++ return (loff_t)le32_to_cpu(raw_inode->i_size_lo); + } + + static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size) +Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/namei.c +=================================================================== +--- linux-3.10.0-229.1.2.fc21.x86_64.orig/fs/ext4/namei.c ++++ linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/namei.c +@@ -513,7 +513,14 @@ struct dx_root_info * dx_get_dx_info(str + + static inline ext4_lblk_t dx_get_block(struct dx_entry *entry) + { +- return le32_to_cpu(entry->block) & 0x00ffffff; ++ return le32_to_cpu(entry->block) & 0x0fffffff; ++} ++ ++static inline int ++ext4_dir_htree_level(struct super_block *sb) ++{ ++ return EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_LARGEDIR) ? ++ EXT4_HTREE_LEVEL : EXT4_HTREE_LEVEL_COMPAT; + } + + static inline void dx_set_block(struct dx_entry *entry, ext4_lblk_t value) +@@ -681,7 +688,7 @@ dx_probe(const struct qstr *d_name, stru + struct dx_frame *frame = frame_in; + u32 hash; + +- frame->bh = NULL; ++ memset(frame_in, 0, EXT4_HTREE_LEVEL * sizeof(frame_in[0])); + bh = ext4_read_dirblock(dir, 0, INDEX); + if (IS_ERR(bh)) { + *err = PTR_ERR(bh); +@@ -714,10 +721,15 @@ dx_probe(const struct qstr *d_name, stru + } + + indirect = info->indirect_levels; +- if (indirect > 1) { +- ext4_warning(dir->i_sb, +- "inode #%lu: unimplemented hash depth %u", +- dir->i_ino, info->indirect_levels); ++ if (indirect >= ext4_dir_htree_level(dir->i_sb)) { ++ ext4_warning(dir->i_sb, ++ "inode #%lu: comm %s: htree depth %#06x exceed max depth %u", ++ dir->i_ino, current->comm, indirect, ++ ext4_dir_htree_level(dir->i_sb)); ++ if (ext4_dir_htree_level(dir->i_sb) < EXT4_HTREE_LEVEL) { ++ ext4_warning(dir->i_sb, "Enable large directory " ++ "feature to access it"); ++ } + brelse(bh); + *err = ERR_BAD_DX_DIR; + goto fail; +@@ -812,13 +826,18 @@ fail: + static void dx_release (struct dx_frame *frames) + { + struct dx_root_info *info; ++ int i; ++ + if (frames[0].bh == NULL) + return; + + info = dx_get_dx_info((struct ext4_dir_entry_2 *)frames[0].bh->b_data); +- if (info->indirect_levels) +- brelse(frames[1].bh); +- brelse(frames[0].bh); ++ for (i = 0; i <= info->indirect_levels; i++) { ++ if (frames[i].bh == NULL) ++ break; ++ brelse(frames[i].bh); ++ frames[i].bh = NULL; ++ } + } + + /* +@@ -960,7 +979,7 @@ int ext4_htree_fill_tree(struct file *di + { + struct dx_hash_info hinfo; + struct ext4_dir_entry_2 *de; +- struct dx_frame frames[2], *frame; ++ struct dx_frame frames[EXT4_HTREE_LEVEL], *frame; + struct inode *dir; + ext4_lblk_t block; + int count = 0; +@@ -1376,7 +1395,7 @@ static struct buffer_head * ext4_dx_find + { + struct super_block * sb = dir->i_sb; + struct dx_hash_info hinfo; +- struct dx_frame frames[2], *frame; ++ struct dx_frame frames[EXT4_HTREE_LEVEL], *frame; + struct buffer_head *bh; + ext4_lblk_t block; + int retval; +@@ -1832,7 +1851,7 @@ static int make_indexed_dir(handle_t *ha + const char *name = dentry->d_name.name; + int namelen = dentry->d_name.len; + struct buffer_head *bh2; +- struct dx_frame frames[2], *frame; ++ struct dx_frame frames[EXT4_HTREE_LEVEL], *frame; + struct dx_entry *entries; + struct ext4_dir_entry_2 *de, *de2, *dot_de, *dotdot_de; + struct ext4_dir_entry_tail *t; +@@ -2117,15 +2136,18 @@ static int ext4_add_entry(handle_t *hand + static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry, + struct inode *inode) + { +- struct dx_frame frames[2], *frame; ++ struct dx_frame frames[EXT4_HTREE_LEVEL], *frame; + struct dx_entry *entries, *at; + struct dx_hash_info hinfo; + struct buffer_head *bh; + struct inode *dir = dentry->d_parent->d_inode; + struct super_block *sb = dir->i_sb; + struct ext4_dir_entry_2 *de; ++ int restart; + int err; + ++again: ++ restart = 0; + frame = dx_probe(&dentry->d_name, dir, &hinfo, frames, &err); + if (!frame) + return err; +@@ -2138,33 +2160,48 @@ static int ext4_dx_add_entry(handle_t *h + goto cleanup; + } + +- BUFFER_TRACE(bh, "get_write_access"); +- err = ext4_journal_get_write_access(handle, bh); +- if (err) +- goto journal_error; +- + err = add_dirent_to_buf(handle, dentry, inode, NULL, bh); + if (err != -ENOSPC) + goto cleanup; + ++ err = 0; + /* Block full, should compress but for now just split */ + dxtrace(printk(KERN_DEBUG "using %u of %u node entries\n", + dx_get_count(entries), dx_get_limit(entries))); + /* Need to split index? */ + if (dx_get_count(entries) == dx_get_limit(entries)) { + ext4_lblk_t newblock; +- unsigned icount = dx_get_count(entries); +- int levels = frame - frames; ++ int levels = frame - frames + 1; ++ unsigned icount; ++ int add_level = 1; + struct dx_entry *entries2; + struct dx_node *node2; + struct buffer_head *bh2; + +- if (levels && (dx_get_count(frames->entries) == +- dx_get_limit(frames->entries))) { +- ext4_warning(sb, "Directory index full!"); ++ while (frame > frames) { ++ if (dx_get_count((frame - 1)->entries) < ++ dx_get_limit((frame - 1)->entries)) { ++ add_level = 0; ++ break; ++ } ++ frame--; /* split higher index block */ ++ at = frame->at; ++ entries = frame->entries; ++ restart = 1; ++ } ++ if (add_level && levels == ext4_dir_htree_level(sb)) { ++ ext4_warning(sb, "inode %lu: comm %s: index %u: reach max htree level %u", ++ dir->i_ino, current->comm, levels, ++ ext4_dir_htree_level(sb)); ++ if (ext4_dir_htree_level(sb) < EXT4_HTREE_LEVEL) { ++ ext4_warning(sb, "Large directory feature is" ++ "not enabled on this " ++ "filesystem"); ++ } + err = -ENOSPC; + goto cleanup; + } ++ icount = dx_get_count(entries); + bh2 = ext4_append(handle, dir, &newblock); + if (IS_ERR(bh2)) { + err = PTR_ERR(bh2); +@@ -2179,7 +2216,7 @@ static int ext4_dx_add_entry(handle_t *h + err = ext4_journal_get_write_access(handle, frame->bh); + if (err) + goto journal_error; +- if (levels) { ++ if (!add_level) { + unsigned icount1 = icount/2, icount2 = icount - icount1; + unsigned hash2 = dx_get_hash(entries + icount1); + dxtrace(printk(KERN_DEBUG "Split index %i/%i\n", +@@ -2187,7 +2224,7 @@ static int ext4_dx_add_entry(handle_t *h + + BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */ + err = ext4_journal_get_write_access(handle, +- frames[0].bh); ++ (frame - 1)->bh); + if (err) + goto journal_error; + +@@ -2203,19 +2240,25 @@ static int ext4_dx_add_entry(handle_t *h + frame->entries = entries = entries2; + swap(frame->bh, bh2); + } +- dx_insert_block(frames + 0, hash2, newblock); +- dxtrace(dx_show_index("node", frames[1].entries)); ++ dx_insert_block(frame - 1, hash2, newblock); ++ dxtrace(dx_show_index("node", frame->entries)); + dxtrace(dx_show_index("node", +- ((struct dx_node *) bh2->b_data)->entries)); ++ ((struct dx_node *)bh2->b_data)->entries)); + err = ext4_handle_dirty_dx_node(handle, dir, bh2); + if (err) + goto journal_error; + brelse (bh2); ++ ext4_handle_dirty_dirent_node(handle, dir, ++ (frame - 1)->bh); ++ if (restart) { ++ ext4_handle_dirty_dirent_node(handle, dir, ++ frame->bh); ++ goto cleanup; ++ } + } else { + struct dx_root_info *info; +- dxtrace(printk(KERN_DEBUG +- "Creating second level index...\n")); +- memcpy((char *) entries2, (char *) entries, ++ ++ memcpy((char *)entries2, (char *)entries, + icount * sizeof(struct dx_entry)); + dx_set_limit(entries2, dx_node_limit(dir)); + +@@ -2224,21 +2267,14 @@ static int ext4_dx_add_entry(handle_t *h + dx_set_block(entries + 0, newblock); + info = dx_get_dx_info((struct ext4_dir_entry_2*) + frames[0].bh->b_data); +- info->indirect_levels = 1; +- +- /* Add new access path frame */ +- frame = frames + 1; +- frame->at = at = at - entries + entries2; +- frame->entries = entries = entries2; +- frame->bh = bh2; +- err = ext4_journal_get_write_access(handle, +- frame->bh); +- if (err) +- goto journal_error; +- } +- err = ext4_handle_dirty_dx_node(handle, dir, frames[0].bh); +- if (err) { +- ext4_std_error(inode->i_sb, err); ++ info->indirect_levels += 1; ++ dxtrace(printk(KERN_DEBUG ++ "Creating %d level index...\n", ++ info->indirect_levels)); ++ ext4_handle_dirty_dirent_node(handle, dir, frame->bh); ++ ext4_handle_dirty_dirent_node(handle, dir, bh2); ++ brelse(bh2); ++ restart = 1; + goto cleanup; + } + } +@@ -2253,6 +2289,10 @@ journal_error: + cleanup: + brelse(bh); + dx_release(frames); ++ /* @restart is true means htree-path has been changed, we need to ++ * repeat dx_probe() to find out valid htree-path */ ++ if (restart && err == 0) ++ goto again; + return err; + } + +Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/inode.c +=================================================================== +--- linux-3.10.0-229.1.2.fc21.x86_64.orig/fs/ext4/inode.c ++++ linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/inode.c +@@ -4056,12 +4056,12 @@ struct inode *ext4_iget(struct super_blo + if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT)) + ei->i_file_acl |= + ((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32; +- inode->i_size = ext4_isize(raw_inode); ++ inode->i_size = ext4_isize(sb, raw_inode); + if ((size = i_size_read(inode)) < 0) { + EXT4_ERROR_INODE(inode, "bad i_size value: %lld", size); + ret = -EIO; + goto bad_inode; + } + ei->i_disksize = inode->i_size; + #ifdef CONFIG_QUOTA + ei->i_reserved_quota = 0; +@@ -4306,7 +4306,7 @@ static int ext4_do_update_inode(handle_t + raw_inode->i_file_acl_high = + cpu_to_le16(ei->i_file_acl >> 32); + raw_inode->i_file_acl_lo = cpu_to_le32(ei->i_file_acl); +- if (ei->i_disksize != ext4_isize(raw_inode)) { ++ if (ei->i_disksize != ext4_isize(inode->i_sb, raw_inode)) { + ext4_isize_set(raw_inode, ei->i_disksize); + need_datasync = 1; + } diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series b/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series index d7acab4..03ce6e3 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series @@ -12,7 +12,7 @@ sles12/ext4-data-in-dirent.patch sles12/ext4-large-eas.patch rhel7/ext4-disable-mb-cache.patch rhel7/ext4-nocmtime.patch -rhel7/ext4-large-dir.patch +sles12sp1/ext4-large-dir.patch sles12/ext4-pdirop.patch rhel7/ext4-max-dir-size.patch rhel7/ext4-remove-truncate-warning.patch diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 69b11e4..8dfdfb9 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -11,7 +11,7 @@ TBD Intel Corporation 3.10.0-514.16.1.el7 (RHEL7.3) 3.0.101-0.47.71 (SLES11 SP3) 3.0.101-100 (SLES11 SP4) - 3.12.69-60.64.35 (SLES12 SP1) + 3.12.74-60.64.40 (SLES12 SP1) 4.4.59-92.17 (SLES12 SP2) vanilla linux 4.6.7 (ZFS only) * Client known to build on unpatched kernels: @@ -23,7 +23,7 @@ TBD Intel Corporation 3.10.0-514.16.1.el7 (RHEL7.3) 3.0.101-0.47.71 (SLES11 SP3) 3.0.101-100 (SLES11 SP4) - 3.12.69-60.64.35 (SLES12 SP1) + 3.12.74-60.64.40 (SLES12 SP1) 4.4.59-92.17 (SLES12 SP2) vanilla linux 4.6.7 * Recommended e2fsprogs version: 1.42.13.wc4 or newer diff --git a/lustre/kernel_patches/kernel_configs/kernel-3.12-3.12-sles12-x86_64.config b/lustre/kernel_patches/kernel_configs/kernel-3.12-3.12-sles12-x86_64.config index ad61a93..bd017ac 100644 --- a/lustre/kernel_patches/kernel_configs/kernel-3.12-3.12-sles12-x86_64.config +++ b/lustre/kernel_patches/kernel_configs/kernel-3.12-3.12-sles12-x86_64.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 3.12.69 Kernel Configuration +# Linux/x86 3.12.74 Kernel Configuration # CONFIG_64BIT=y CONFIG_X86_64=y @@ -54,7 +54,7 @@ CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set -CONFIG_LOCALVERSION="-60.64.35-default" +CONFIG_LOCALVERSION="-60.64.40-default" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y @@ -1234,7 +1234,6 @@ CONFIG_OPENVSWITCH_GRE=y CONFIG_OPENVSWITCH_VXLAN=y CONFIG_VSOCKETS=m CONFIG_VMWARE_VMCI_VSOCKETS=m -CONFIG_NETLINK_MMAP=y CONFIG_NETLINK_DIAG=m CONFIG_NET_MPLS_GSO=m CONFIG_RPS=y @@ -1990,16 +1989,17 @@ CONFIG_BLK_DEV_DM=m CONFIG_DM_BUFIO=m CONFIG_DM_BIO_PRISON=m CONFIG_DM_PERSISTENT_DATA=m +# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_THIN_PROVISIONING=m -# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set CONFIG_DM_CACHE=m CONFIG_DM_CACHE_MQ=m CONFIG_DM_CACHE_CLEANER=m +# CONFIG_DM_ERA is not set CONFIG_DM_MIRROR=m -CONFIG_DM_RAID=m CONFIG_DM_LOG_USERSPACE=m +CONFIG_DM_RAID=m CONFIG_DM_ZERO=m CONFIG_DM_MULTIPATH=m CONFIG_DM_MULTIPATH_QL=m diff --git a/lustre/kernel_patches/targets/3.12-sles12.target.in b/lustre/kernel_patches/targets/3.12-sles12.target.in index 1e7702f..c357710 100644 --- a/lustre/kernel_patches/targets/3.12-sles12.target.in +++ b/lustre/kernel_patches/targets/3.12-sles12.target.in @@ -1,6 +1,6 @@ lnxmaj="3.12" -lnxmin=".69" -lnxrel="60.64.35" +lnxmin=".74" +lnxrel="60.64.40" # use this when there is an "RPM fix" which means that the name of the # (source) RPM has been updated but the version of the kernel inside the # RPM is not also updated diff --git a/lustre/kernel_patches/which_patch b/lustre/kernel_patches/which_patch index 325e103..f65efea 100644 --- a/lustre/kernel_patches/which_patch +++ b/lustre/kernel_patches/which_patch @@ -21,7 +21,7 @@ PATCH SERIES FOR SERVER KERNELS: 3.10-rhel7.series 3.10.0-514.16.1.el7 (RHEL 7.3) 3.0-sles11sp3.series 3.0.101-0.47.71 (SLES11 SP3) 3.0-sles11sp3.series 3.0.101-100 (SLES11 SP4) -3.12-sles12.series 3.12.69-60.64.35 (SLES12 SP1) +3.12-sles12.series 3.12.74-60.64.40 (SLES12 SP1) 4.4-sles12.series 4.4.59-92.17 (SLES12 SP2) See lustre/ChangeLog for supported client kernel versions.