Linux commit v5.9-rc7-39-g6866d7b3f2bb
ext4 / jbd2: add fast commit initialization
Disable journal fast commit buffer via a mount option because it is
not used by lustre's ldiskfs since it will break recovery.
Linux commit v5.10-rc2-9-gede7dc7fa0af
jbd2: rename j_maxlen to j_total_len and add
jbd2_journal_max_txn_bufs
Change osd_transaction_size to use jbd2_journal_get_max_txn_bufs
and provide a jbd2_journal_get_max_txn_bufs when it is not
provided.
Test-Parameters: trivial
HPE-bug-id: LUS-10858
Fixes:
c93a3e5b15 ("LU-14195 ldiskfs: update patches for Linux 5.10")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I9bffc3559a8bbce9d4c1c2b6692cb8518f3f991a
Reviewed-on: https://review.whamcloud.com/46943
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
]) # LB_EXT4_INC_DEC_COUNT_2ARGS
#
+# LB_JBD2_JOURNAL_GET_MAX_TXN_BUFS
+# Linux commit v5.10-rc2-9-gede7dc7fa0af
+# jbd2: rename j_maxlen to j_total_len and add jbd2_journal_max_txn_bufs
+#
+AC_DEFUN([LB_JBD2_JOURNAL_GET_MAX_TXN_BUFS], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if jbd2_journal_get_max_txn_bufs is available],
+jbd2_journal_get_max_txn_bufs, [
+ #include <linux/jbd2.h>
+],[
+ journal_t *journal = NULL;
+ int x = jbd2_journal_get_max_txn_bufs(journal);
+ (void)x;
+],[
+ AC_DEFINE(HAVE_JBD2_JOURNAL_GET_MAX_TXN_BUFS, 1,
+ [if jbd2_journal_get_max_txn_bufs is available])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LB_JBD2_JOURNAL_GET_MAX_TXN_BUFS
+
+#
# LB_CONFIG_LDISKFS
#
AC_DEFUN([LB_CONFIG_LDISKFS], [
LB_JBD2_H_TOTAL_CREDITS
LB_EXT4_GET_BLOCKS_KEEP_SIZE
LB_EXT4_INC_DEC_COUNT_2ARGS
+ LB_JBD2_JOURNAL_GET_MAX_TXN_BUFS
AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [posix acls for ldiskfs])
AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [fs security for ldiskfs])
AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [extened attributes for ldiskfs])
# define osd_attach_jinode(inode) 0
#endif /* HAVE_LDISKFS_INFO_JINODE */
+#ifndef HAVE_JBD2_JOURNAL_GET_MAX_TXN_BUFS
+#define jbd2_journal_get_max_txn_bufs(jrnl) \
+ (jrnl->j_max_transaction_buffers)
+#endif
+
#ifdef LDISKFS_HT_MISC
# define osd_journal_start_sb(sb, type, nblock) \
ldiskfs_journal_start_sb(sb, type, nblock)
# define osd_journal_start(inode, type, nblocks) \
ldiskfs_journal_start(inode, type, nblocks)
# define osd_transaction_size(dev) \
- (osd_journal(dev)->j_max_transaction_buffers / 2)
+ (jbd2_journal_get_max_txn_bufs(osd_journal(dev)) / 2)
#else /* ! defined LDISKFS_HT_MISC */
# define LDISKFS_HT_MISC 0
# define osd_journal_start_sb(sb, type, nblock) \
# define osd_journal_start(inode, type, nblocks) \
ldiskfs_journal_start(inode, nblocks)
# define osd_transaction_size(dev) \
- (osd_journal(dev)->j_max_transaction_buffers)
+ jbd2_journal_get_max_txn_bufs(osd_journal(dev))
#endif /* LDISKFS_HT_MISC */
#ifndef HAVE___LDISKFS_FIND_ENTRY
if (IS_MDT(&mop->mo_ldd) && is_e2fsprogs_feature_supp("-O large_dir"))
append_unique(anchor, ",", "large_dir", NULL, maxbuflen);
+ /* Disable fast_commit since it breaks ldiskfs transactions ordering */
+ if (is_e2fsprogs_feature_supp("fast_commit"))
+ append_unique(anchor, ",", "^fast_commit", NULL, maxbuflen);
+
/* Cluster inode/block bitmaps and inode table for more efficient IO.
* Align the flex groups on a 1MB boundary for better performance. */
/* This -O feature needs to go last, since it adds the "-G" option. */