Commit 76c0f27d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-hotfixes-stable-2024-09-03-20-19' of...

Merge tag 'mm-hotfixes-stable-2024-09-03-20-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "17 hotfixes, 15 of which are cc:stable.

  Mostly MM, no identifiable theme.  And a few nilfs2 fixups"

* tag 'mm-hotfixes-stable-2024-09-03-20-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  alloc_tag: fix allocation tag reporting when CONFIG_MODULES=n
  mm: vmalloc: optimize vmap_lazy_nr arithmetic when purging each vmap_area
  mailmap: update entry for Jan Kuliga
  codetag: debug: mark codetags for poisoned page as empty
  mm/memcontrol: respect zswap.writeback setting from parent cg too
  scripts: fix gfp-translate after ___GFP_*_BITS conversion to an enum
  Revert "mm: skip CMA pages when they are not available"
  maple_tree: remove rcu_read_lock() from mt_validate()
  kexec_file: fix elfcorehdr digest exclusion when CONFIG_CRASH_HOTPLUG=y
  mm/slub: add check for s->flags in the alloc_tagging_slab_free_hook
  nilfs2: fix state management in error path of log writing function
  nilfs2: fix missing cleanup on rollforward recovery error
  nilfs2: protect references to superblock parameters exposed in sysfs
  userfaultfd: don't BUG_ON() if khugepaged yanks our page table
  userfaultfd: fix checks for huge PMDs
  mm: vmalloc: ensure vmap_block is initialised before adding to queue
  selftests: mm: fix build errors on armhf
parents 88fac175 052a45c1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ James Ketrenos <jketreno@io.(none)>
Jan Glauber <jan.glauber@gmail.com> <jang@de.ibm.com>
Jan Glauber <jan.glauber@gmail.com> <jang@linux.vnet.ibm.com>
Jan Glauber <jan.glauber@gmail.com> <jglauber@cavium.com>
Jan Kuliga <jtkuliga.kdev@gmail.com> <jankul@alatek.krakow.pl>
Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@linux.intel.com>
Jarkko Sakkinen <jarkko@kernel.org> <jarkko@profian.com>
Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@tuni.fi>
+4 −3
Original line number Diff line number Diff line
@@ -1717,9 +1717,10 @@ The following nested keys are defined.
	entries fault back in or are written out to disk.

  memory.zswap.writeback
	A read-write single value file. The default value is "1". The
	initial value of the root cgroup is 1, and when a new cgroup is
	created, it inherits the current value of its parent.
	A read-write single value file. The default value is "1".
	Note that this setting is hierarchical, i.e. the writeback would be
	implicitly disabled for child cgroups if the upper hierarchy
	does so.

	When this is set to 0, all swapping attempts to swapping devices
	are disabled. This included both zswap writebacks, and swapping due
+33 −2
Original line number Diff line number Diff line
@@ -715,6 +715,33 @@ static void nilfs_finish_roll_forward(struct the_nilfs *nilfs,
	brelse(bh);
}

/**
 * nilfs_abort_roll_forward - cleaning up after a failed rollforward recovery
 * @nilfs: nilfs object
 */
static void nilfs_abort_roll_forward(struct the_nilfs *nilfs)
{
	struct nilfs_inode_info *ii, *n;
	LIST_HEAD(head);

	/* Abandon inodes that have read recovery data */
	spin_lock(&nilfs->ns_inode_lock);
	list_splice_init(&nilfs->ns_dirty_files, &head);
	spin_unlock(&nilfs->ns_inode_lock);
	if (list_empty(&head))
		return;

	set_nilfs_purging(nilfs);
	list_for_each_entry_safe(ii, n, &head, i_dirty) {
		spin_lock(&nilfs->ns_inode_lock);
		list_del_init(&ii->i_dirty);
		spin_unlock(&nilfs->ns_inode_lock);

		iput(&ii->vfs_inode);
	}
	clear_nilfs_purging(nilfs);
}

/**
 * nilfs_salvage_orphan_logs - salvage logs written after the latest checkpoint
 * @nilfs: nilfs object
@@ -773,15 +800,19 @@ int nilfs_salvage_orphan_logs(struct the_nilfs *nilfs,
		if (unlikely(err)) {
			nilfs_err(sb, "error %d writing segment for recovery",
				  err);
			goto failed;
			goto put_root;
		}

		nilfs_finish_roll_forward(nilfs, ri);
	}

 failed:
put_root:
	nilfs_put_root(root);
	return err;

failed:
	nilfs_abort_roll_forward(nilfs);
	goto put_root;
}

/**
+6 −4
Original line number Diff line number Diff line
@@ -1812,6 +1812,9 @@ static void nilfs_segctor_abort_construction(struct nilfs_sc_info *sci,
	nilfs_abort_logs(&logs, ret ? : err);

	list_splice_tail_init(&sci->sc_segbufs, &logs);
	if (list_empty(&logs))
		return; /* if the first segment buffer preparation failed */

	nilfs_cancel_segusage(&logs, nilfs->ns_sufile);
	nilfs_free_incomplete_logs(&logs, nilfs);

@@ -2056,7 +2059,7 @@ static int nilfs_segctor_do_construct(struct nilfs_sc_info *sci, int mode)

		err = nilfs_segctor_begin_construction(sci, nilfs);
		if (unlikely(err))
			goto out;
			goto failed;

		/* Update time stamp */
		sci->sc_seg_ctime = ktime_get_real_seconds();
@@ -2120,10 +2123,9 @@ static int nilfs_segctor_do_construct(struct nilfs_sc_info *sci, int mode)
	return err;

 failed_to_write:
	if (sci->sc_stage.flags & NILFS_CF_IFILE_STARTED)
		nilfs_redirty_inodes(&sci->sc_dirty_files);

 failed:
	if (mode == SC_LSEG_SR && nilfs_sc_cstage_get(sci) >= NILFS_ST_IFILE)
		nilfs_redirty_inodes(&sci->sc_dirty_files);
	if (nilfs_doing_gc())
		nilfs_redirty_inodes(&sci->sc_gc_inodes);
	nilfs_segctor_abort_construction(sci, nilfs, err);
+33 −10
Original line number Diff line number Diff line
@@ -836,9 +836,15 @@ ssize_t nilfs_dev_revision_show(struct nilfs_dev_attr *attr,
				struct the_nilfs *nilfs,
				char *buf)
{
	struct nilfs_super_block **sbp = nilfs->ns_sbp;
	u32 major = le32_to_cpu(sbp[0]->s_rev_level);
	u16 minor = le16_to_cpu(sbp[0]->s_minor_rev_level);
	struct nilfs_super_block *raw_sb;
	u32 major;
	u16 minor;

	down_read(&nilfs->ns_sem);
	raw_sb = nilfs->ns_sbp[0];
	major = le32_to_cpu(raw_sb->s_rev_level);
	minor = le16_to_cpu(raw_sb->s_minor_rev_level);
	up_read(&nilfs->ns_sem);

	return sysfs_emit(buf, "%d.%d\n", major, minor);
}
@@ -856,8 +862,13 @@ ssize_t nilfs_dev_device_size_show(struct nilfs_dev_attr *attr,
				    struct the_nilfs *nilfs,
				    char *buf)
{
	struct nilfs_super_block **sbp = nilfs->ns_sbp;
	u64 dev_size = le64_to_cpu(sbp[0]->s_dev_size);
	struct nilfs_super_block *raw_sb;
	u64 dev_size;

	down_read(&nilfs->ns_sem);
	raw_sb = nilfs->ns_sbp[0];
	dev_size = le64_to_cpu(raw_sb->s_dev_size);
	up_read(&nilfs->ns_sem);

	return sysfs_emit(buf, "%llu\n", dev_size);
}
@@ -879,9 +890,15 @@ ssize_t nilfs_dev_uuid_show(struct nilfs_dev_attr *attr,
			    struct the_nilfs *nilfs,
			    char *buf)
{
	struct nilfs_super_block **sbp = nilfs->ns_sbp;
	struct nilfs_super_block *raw_sb;
	ssize_t len;

	return sysfs_emit(buf, "%pUb\n", sbp[0]->s_uuid);
	down_read(&nilfs->ns_sem);
	raw_sb = nilfs->ns_sbp[0];
	len = sysfs_emit(buf, "%pUb\n", raw_sb->s_uuid);
	up_read(&nilfs->ns_sem);

	return len;
}

static
@@ -889,10 +906,16 @@ ssize_t nilfs_dev_volume_name_show(struct nilfs_dev_attr *attr,
				    struct the_nilfs *nilfs,
				    char *buf)
{
	struct nilfs_super_block **sbp = nilfs->ns_sbp;
	struct nilfs_super_block *raw_sb;
	ssize_t len;

	down_read(&nilfs->ns_sem);
	raw_sb = nilfs->ns_sbp[0];
	len = scnprintf(buf, sizeof(raw_sb->s_volume_name), "%s\n",
			raw_sb->s_volume_name);
	up_read(&nilfs->ns_sem);

	return scnprintf(buf, sizeof(sbp[0]->s_volume_name), "%s\n",
			 sbp[0]->s_volume_name);
	return len;
}

static const char dev_readme_str[] =
Loading