Commit 8dd71685 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
 "12 patches.

  Subsystems affected by this patch series: sysctl, binfmt, ia64, mm
  (memory-failure, folios, kasan, and psi), selftests, and ocfs2"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  ocfs2: fix a deadlock when commit trans
  jbd2: export jbd2_journal_[grab|put]_journal_head
  psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n
  psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n
  mm, kasan: use compare-exchange operation to set KASAN page tag
  kasan: test: fix compatibility with FORTIFY_SOURCE
  tools/testing/scatterlist: add missing defines
  mm: page->mapping folio->mapping should have the same offset
  memory-failure: fetch compound_head after pgmap_pfn_valid()
  ia64: make IA64_MCA_RECOVERY bool instead of tristate
  binfmt_misc: fix crash when load/unload module
  include/linux/sysctl.h: fix register_sysctl_mount_point() return type
parents f8c7e4ed ddf4b773
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ config ARCH_PROC_KCORE_TEXT
	depends on PROC_KCORE

config IA64_MCA_RECOVERY
	tristate "MCA recovery from errors other than TLB."
	bool "MCA recovery from errors other than TLB."

config IA64_PALINFO
	tristate "/proc/pal support"
+4 −4
Original line number Diff line number Diff line
@@ -817,20 +817,20 @@ static struct file_system_type bm_fs_type = {
};
MODULE_ALIAS_FS("binfmt_misc");

static struct ctl_table_header *binfmt_misc_header;

static int __init init_misc_binfmt(void)
{
	int err = register_filesystem(&bm_fs_type);
	if (!err)
		insert_binfmt(&misc_format);
	if (!register_sysctl_mount_point("fs/binfmt_misc")) {
		pr_warn("Failed to create fs/binfmt_misc sysctl mount point");
		return -ENOMEM;
	}
	binfmt_misc_header = register_sysctl_mount_point("fs/binfmt_misc");
	return 0;
}

static void __exit exit_misc_binfmt(void)
{
	unregister_sysctl_table(binfmt_misc_header);
	unregister_binfmt(&misc_format);
	unregister_filesystem(&bm_fs_type);
}
+2 −0
Original line number Diff line number Diff line
@@ -2972,6 +2972,7 @@ struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh)
	jbd_unlock_bh_journal_head(bh);
	return jh;
}
EXPORT_SYMBOL(jbd2_journal_grab_journal_head);

static void __journal_remove_journal_head(struct buffer_head *bh)
{
@@ -3024,6 +3025,7 @@ void jbd2_journal_put_journal_head(struct journal_head *jh)
		jbd_unlock_bh_journal_head(bh);
	}
}
EXPORT_SYMBOL(jbd2_journal_put_journal_head);

/*
 * Initialize jbd inode head
+11 −14
Original line number Diff line number Diff line
@@ -1251,17 +1251,15 @@ static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
{
	struct ocfs2_group_desc *bg = (struct ocfs2_group_desc *) bg_bh->b_data;
	struct journal_head *jh;
	int ret = 1;
	int ret;

	if (ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap))
		return 0;

	if (!buffer_jbd(bg_bh))
	jh = jbd2_journal_grab_journal_head(bg_bh);
	if (!jh)
		return 1;

	jbd_lock_bh_journal_head(bg_bh);
	if (buffer_jbd(bg_bh)) {
		jh = bh2jh(bg_bh);
	spin_lock(&jh->b_state_lock);
	bg = (struct ocfs2_group_desc *) jh->b_committed_data;
	if (bg)
@@ -1269,8 +1267,7 @@ static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
	else
		ret = 1;
	spin_unlock(&jh->b_state_lock);
	}
	jbd_unlock_bh_journal_head(bg_bh);
	jbd2_journal_put_journal_head(jh);

	return ret;
}
+12 −5
Original line number Diff line number Diff line
@@ -1506,11 +1506,18 @@ static inline u8 page_kasan_tag(const struct page *page)

static inline void page_kasan_tag_set(struct page *page, u8 tag)
{
	if (kasan_enabled()) {
	unsigned long old_flags, flags;

	if (!kasan_enabled())
		return;

	tag ^= 0xff;
		page->flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT);
		page->flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT;
	}
	old_flags = READ_ONCE(page->flags);
	do {
		flags = old_flags;
		flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT);
		flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT;
	} while (unlikely(!try_cmpxchg(&page->flags, &old_flags, flags)));
}

static inline void page_kasan_tag_reset(struct page *page)
Loading