Commit 39c3c396 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-hotfixes-stable-2022-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "Thirteen hotfixes.

  Eight are cc:stable and the remainder are for post-5.18 issues or are
  too minor to warrant backporting"

* tag 'mm-hotfixes-stable-2022-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mailmap: update Gao Xiang's email addresses
  userfaultfd: provide properly masked address for huge-pages
  Revert "ocfs2: mount shared volume without ha stack"
  hugetlb: fix memoryleak in hugetlb_mcopy_atomic_pte
  fs: sendfile handles O_NONBLOCK of out_fd
  ntfs: fix use-after-free in ntfs_ucsncmp()
  secretmem: fix unhandled fault in truncate
  mm/hugetlb: separate path for hwpoison entry in copy_hugetlb_page_range()
  mm: fix missing wake-up event for FSDAX pages
  mm: fix page leak with multiple threads mapping the same page
  mailmap: update Seth Forshee's email address
  tmpfs: fix the issue that the mount and remount results are inconsistent.
  mm: kfence: apply kmemleak_ignore_phys on early allocated pool
parents 5de64d44 1f7ea547
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ Frank Rowand <frowand.list@gmail.com> <frowand@mvista.com>
Frank Zago <fzago@systemfabricworks.com>
Gao Xiang <xiang@kernel.org> <gaoxiang25@huawei.com>
Gao Xiang <xiang@kernel.org> <hsiangkao@aol.com>
Gao Xiang <xiang@kernel.org> <hsiangkao@linux.alibaba.com>
Gao Xiang <xiang@kernel.org> <hsiangkao@redhat.com>
Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@de.ibm.com>
Gerald Schaefer <gerald.schaefer@linux.ibm.com> <gerald.schaefer@de.ibm.com>
Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@linux.vnet.ibm.com>
@@ -371,6 +373,7 @@ Sean Nyekjaer <sean@geanix.com> <sean.nyekjaer@prevas.dk>
Sebastian Reichel <sre@kernel.org> <sebastian.reichel@collabora.co.uk>
Sebastian Reichel <sre@kernel.org> <sre@debian.org>
Sedat Dilek <sedat.dilek@gmail.com> <sedat.dilek@credativ.de>
Seth Forshee <sforshee@kernel.org> <seth.forshee@canonical.com>
Shiraz Hashim <shiraz.linux.kernel@gmail.com> <shiraz.hashim@st.com>
Shuah Khan <shuah@kernel.org> <shuahkhan@gmail.com>
Shuah Khan <shuah@kernel.org> <shuah.khan@hp.com>
+6 −2
Original line number Diff line number Diff line
@@ -592,8 +592,12 @@ static int ntfs_attr_find(const ATTR_TYPE type, const ntfschar *name,
		a = (ATTR_RECORD*)((u8*)ctx->attr +
				le32_to_cpu(ctx->attr->length));
	for (;;	a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))) {
		if ((u8*)a < (u8*)ctx->mrec || (u8*)a > (u8*)ctx->mrec +
				le32_to_cpu(ctx->mrec->bytes_allocated))
		u8 *mrec_end = (u8 *)ctx->mrec +
		               le32_to_cpu(ctx->mrec->bytes_allocated);
		u8 *name_end = (u8 *)a + le16_to_cpu(a->name_offset) +
			       a->name_length * sizeof(ntfschar);
		if ((u8*)a < (u8*)ctx->mrec || (u8*)a > mrec_end ||
		    name_end > mrec_end)
			break;
		ctx->attr = a;
		if (unlikely(le32_to_cpu(a->type) > le32_to_cpu(type) ||
+1 −3
Original line number Diff line number Diff line
@@ -277,7 +277,6 @@ enum ocfs2_mount_options
	OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT = 1 << 15,  /* Journal Async Commit */
	OCFS2_MOUNT_ERRORS_CONT = 1 << 16, /* Return EIO to the calling process on error */
	OCFS2_MOUNT_ERRORS_ROFS = 1 << 17, /* Change filesystem to read-only on error */
	OCFS2_MOUNT_NOCLUSTER = 1 << 18, /* No cluster aware filesystem mount */
};

#define OCFS2_OSB_SOFT_RO	0x0001
@@ -673,8 +672,7 @@ static inline int ocfs2_cluster_o2cb_global_heartbeat(struct ocfs2_super *osb)

static inline int ocfs2_mount_local(struct ocfs2_super *osb)
{
	return ((osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT)
		|| (osb->s_mount_opt & OCFS2_MOUNT_NOCLUSTER));
	return (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT);
}

static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
+19 −27
Original line number Diff line number Diff line
@@ -252,16 +252,14 @@ static int __ocfs2_find_empty_slot(struct ocfs2_slot_info *si,
	int i, ret = -ENOSPC;

	if ((preferred >= 0) && (preferred < si->si_num_slots)) {
		if (!si->si_slots[preferred].sl_valid ||
		    !si->si_slots[preferred].sl_node_num) {
		if (!si->si_slots[preferred].sl_valid) {
			ret = preferred;
			goto out;
		}
	}

	for(i = 0; i < si->si_num_slots; i++) {
		if (!si->si_slots[i].sl_valid ||
		    !si->si_slots[i].sl_node_num) {
		if (!si->si_slots[i].sl_valid) {
			ret = i;
			break;
		}
@@ -456,10 +454,6 @@ int ocfs2_find_slot(struct ocfs2_super *osb)
	spin_lock(&osb->osb_lock);
	ocfs2_update_slot_info(si);

	if (ocfs2_mount_local(osb))
		/* use slot 0 directly in local mode */
		slot = 0;
	else {
	/* search for ourselves first and take the slot if it already
	 * exists. Perhaps we need to mark this in a variable for our
	 * own journal recovery? Possibly not, though we certainly
@@ -476,10 +470,8 @@ int ocfs2_find_slot(struct ocfs2_super *osb)
			goto bail;
		}
	} else
			printk(KERN_INFO "ocfs2: Slot %d on device (%s) was "
			       "already allocated to this node!\n",
			       slot, osb->dev_str);
	}
		printk(KERN_INFO "ocfs2: Slot %d on device (%s) was already "
		       "allocated to this node!\n", slot, osb->dev_str);

	ocfs2_set_slot(si, slot, osb->node_num);
	osb->slot_num = slot;
+0 −21
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ enum {
	Opt_dir_resv_level,
	Opt_journal_async_commit,
	Opt_err_cont,
	Opt_nocluster,
	Opt_err,
};

@@ -206,7 +205,6 @@ static const match_table_t tokens = {
	{Opt_dir_resv_level, "dir_resv_level=%u"},
	{Opt_journal_async_commit, "journal_async_commit"},
	{Opt_err_cont, "errors=continue"},
	{Opt_nocluster, "nocluster"},
	{Opt_err, NULL}
};

@@ -618,13 +616,6 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
		goto out;
	}

	tmp = OCFS2_MOUNT_NOCLUSTER;
	if ((osb->s_mount_opt & tmp) != (parsed_options.mount_opt & tmp)) {
		ret = -EINVAL;
		mlog(ML_ERROR, "Cannot change nocluster option on remount\n");
		goto out;
	}

	tmp = OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL |
		OCFS2_MOUNT_HB_NONE;
	if ((osb->s_mount_opt & tmp) != (parsed_options.mount_opt & tmp)) {
@@ -865,7 +856,6 @@ static int ocfs2_verify_userspace_stack(struct ocfs2_super *osb,
	}

	if (ocfs2_userspace_stack(osb) &&
	    !(osb->s_mount_opt & OCFS2_MOUNT_NOCLUSTER) &&
	    strncmp(osb->osb_cluster_stack, mopt->cluster_stack,
		    OCFS2_STACK_LABEL_LEN)) {
		mlog(ML_ERROR,
@@ -1137,11 +1127,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
	       osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK ? "writeback" :
	       "ordered");

	if ((osb->s_mount_opt & OCFS2_MOUNT_NOCLUSTER) &&
	   !(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT))
		printk(KERN_NOTICE "ocfs2: The shared device (%s) is mounted "
		       "without cluster aware mode.\n", osb->dev_str);

	atomic_set(&osb->vol_state, VOLUME_MOUNTED);
	wake_up(&osb->osb_mount_event);

@@ -1452,9 +1437,6 @@ static int ocfs2_parse_options(struct super_block *sb,
		case Opt_journal_async_commit:
			mopt->mount_opt |= OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT;
			break;
		case Opt_nocluster:
			mopt->mount_opt |= OCFS2_MOUNT_NOCLUSTER;
			break;
		default:
			mlog(ML_ERROR,
			     "Unrecognized mount option \"%s\" "
@@ -1566,9 +1548,6 @@ static int ocfs2_show_options(struct seq_file *s, struct dentry *root)
	if (opts & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
		seq_printf(s, ",journal_async_commit");

	if (opts & OCFS2_MOUNT_NOCLUSTER)
		seq_printf(s, ",nocluster");

	return 0;
}

Loading