Commit 8ef6fd0e authored by Andrew Morton's avatar Andrew Morton
Browse files

Merge branch 'mm-hotfixes-stable' into mm-stable to pick up "mm: fix

crashes from deferred split racing folio migration", needed by "mm:
migrate: split folio_migrate_mapping()".
parents 44195d1e 1e3d28fe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -384,6 +384,7 @@ Li Yang <leoyang.li@nxp.com> <leoli@freescale.com>
Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org>
Lior David <quic_liord@quicinc.com> <liord@codeaurora.org>
Lorenzo Pieralisi <lpieralisi@kernel.org> <lorenzo.pieralisi@arm.com>
Lorenzo Stoakes <lorenzo.stoakes@oracle.com> <lstoakes@gmail.com>
Luca Ceresoli <luca.ceresoli@bootlin.com> <luca@lucaceresoli.net>
Lukasz Luba <lukasz.luba@arm.com> <l.luba@partner.samsung.com>
Luo Jie <quic_luoj@quicinc.com> <luoj@codeaurora.org>
+1 −1
Original line number Diff line number Diff line
@@ -14476,7 +14476,7 @@ MEMORY MAPPING
M:	Andrew Morton <akpm@linux-foundation.org>
R:	Liam R. Howlett <Liam.Howlett@oracle.com>
R:	Vlastimil Babka <vbabka@suse.cz>
R:	Lorenzo Stoakes <lstoakes@gmail.com>
R:	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
L:	linux-mm@kvack.org
S:	Maintained
W:	http://www.linux-mm.org
+30 −2
Original line number Diff line number Diff line
@@ -383,11 +383,39 @@ struct nilfs_dir_entry *nilfs_find_entry(struct inode *dir,

struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct folio **foliop)
{
	struct nilfs_dir_entry *de = nilfs_get_folio(dir, 0, foliop);
	struct folio *folio;
	struct nilfs_dir_entry *de, *next_de;
	size_t limit;
	char *msg;

	de = nilfs_get_folio(dir, 0, &folio);
	if (IS_ERR(de))
		return NULL;
	return nilfs_next_entry(de);

	limit = nilfs_last_byte(dir, 0);  /* is a multiple of chunk size */
	if (unlikely(!limit || le64_to_cpu(de->inode) != dir->i_ino ||
		     !nilfs_match(1, ".", de))) {
		msg = "missing '.'";
		goto fail;
	}

	next_de = nilfs_next_entry(de);
	/*
	 * If "next_de" has not reached the end of the chunk, there is
	 * at least one more record.  Check whether it matches "..".
	 */
	if (unlikely((char *)next_de == (char *)de + nilfs_chunk_size(dir) ||
		     !nilfs_match(2, "..", next_de))) {
		msg = "missing '..'";
		goto fail;
	}
	*foliop = folio;
	return next_de;

fail:
	nilfs_error(dir->i_sb, "directory #%lu %s", dir->i_ino, msg);
	folio_release_kmap(folio, de);
	return NULL;
}

ino_t nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr)
+6 −1
Original line number Diff line number Diff line
@@ -2057,7 +2057,7 @@ static int userfaultfd_api(struct userfaultfd_ctx *ctx,
		goto out;
	features = uffdio_api.features;
	ret = -EINVAL;
	if (uffdio_api.api != UFFD_API || (features & ~UFFD_API_FEATURES))
	if (uffdio_api.api != UFFD_API)
		goto err_out;
	ret = -EPERM;
	if ((features & UFFD_FEATURE_EVENT_FORK) && !capable(CAP_SYS_PTRACE))
@@ -2081,6 +2081,11 @@ static int userfaultfd_api(struct userfaultfd_ctx *ctx,
	uffdio_api.features &= ~UFFD_FEATURE_WP_UNPOPULATED;
	uffdio_api.features &= ~UFFD_FEATURE_WP_ASYNC;
#endif

	ret = -EINVAL;
	if (features & ~uffdio_api.features)
		goto err_out;

	uffdio_api.ioctls = UFFD_API_IOCTLS;
	ret = -EFAULT;
	if (copy_to_user(buf, &uffdio_api, sizeof(uffdio_api)))
+2 −1
Original line number Diff line number Diff line
@@ -1981,8 +1981,9 @@ static inline int subsection_map_index(unsigned long pfn)
static inline int pfn_section_valid(struct mem_section *ms, unsigned long pfn)
{
	int idx = subsection_map_index(pfn);
	struct mem_section_usage *usage = READ_ONCE(ms->usage);

	return test_bit(idx, READ_ONCE(ms->usage)->subsection_map);
	return usage ? test_bit(idx, usage->subsection_map) : 0;
}
#else
static inline int pfn_section_valid(struct mem_section *ms, unsigned long pfn)
Loading