* linux-next: manual merge of the mm-nonmm-unstable tree with the vfs-brauner-fixes tree
@ 2026-11-16 15:53 Mark Brown
2026-11-16 21:42 ` [PATCH linux-next] profiling: keep the error message in the mm-nonmm-unstable merge Sasha Levin
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2026-11-16 15:53 UTC (permalink / raw)
To: Andrew Morton
Cc: Christian Brauner, Linux Kernel Mailing List,
Linux Next Mailing List, Yongxin Yang
[-- Attachment #1: Type: text/plain, Size: 3298 bytes --]
Hi all,
Today's linux-next merge of the mm-nonmm-unstable tree got a conflict in:
kernel/profile.c
between commit:
944b8062bc6f6 ("profiling: report it when /proc/profile can't be created")
from the vfs-brauner-fixes tree and commit:
091be6dce28ab ("perf/profile: report failure to create /proc/profile")
from the mm-nonmm-unstable tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --combined kernel/profile.c
index 820d5ec909d40,818098cc094a5..0000000000000
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@@ -153,28 -153,52 +153,52 @@@ void profile_tick(int type
static ssize_t
read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
- unsigned long p = *ppos;
- ssize_t read;
- char *pnt;
- unsigned int sample_step = (unsigned int)(1UL << prof_shift);
+ const size_t header_size = sizeof(unsigned int);
+ const size_t file_size = (prof_len + 1) * sizeof(unsigned int);
+ unsigned int sample_step;
+ loff_t offset = *ppos;
+ size_t pos;
+ size_t done = 0;
+ size_t n, not_copied;
- if (p >= (prof_len+1)*sizeof(unsigned int))
+ /* Keep the shift word-sized before narrowing to the 32-bit ABI. */
+ sample_step = (unsigned int)(1UL << prof_shift);
+
+ if (offset < 0)
+ return -EINVAL;
+ if (offset >= file_size)
return 0;
- if (count > (prof_len+1)*sizeof(unsigned int) - p)
- count = (prof_len+1)*sizeof(unsigned int) - p;
- read = 0;
+ pos = offset;
+ count = min(count, file_size - pos);
- while (p < sizeof(unsigned int) && count > 0) {
- if (put_user(*((char *)(&sample_step)+p), buf))
- return -EFAULT;
- buf++; p++; count--; read++;
+ /* Copy the four-byte sampling resolution. */
+ if (pos < header_size) {
+ n = min(count, header_size - pos);
+ not_copied = copy_to_user(buf, (u8 *)&sample_step + pos, n);
+ done += n - not_copied;
+ if (not_copied)
+ goto fault;
+ buf += n;
+ pos += n;
+ count -= n;
}
- pnt = (char *)prof_buffer + p - sizeof(atomic_t);
- if (copy_to_user(buf, (void *)pnt, count))
+
+ /* Copy raw counters using offsets relative to the counter array. */
+ if (count) {
+ not_copied = copy_to_user(buf,
+ (u8 *)prof_buffer + pos - header_size,
+ count);
+ done += count - not_copied;
+ if (not_copied)
+ goto fault;
+ }
+ *ppos += done;
+ return done;
+ fault:
+ *ppos += done;
+ if (!done)
return -EFAULT;
- read += count;
- *ppos += read;
- return read;
+ return done;
}
/* default is to not implement this call */
@@@ -221,8 -245,10 +245,8 @@@ int __ref create_proc_profile(void
return 0;
entry = proc_create("profile", S_IWUSR | S_IRUGO,
NULL, &profile_proc_ops);
- if (!entry) {
- pr_err("profile: failed to create /proc/profile\n");
+ if (!entry)
return -ENOMEM;
- }
proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t));
return 0;
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH linux-next] profiling: keep the error message in the mm-nonmm-unstable merge
2026-11-16 15:53 linux-next: manual merge of the mm-nonmm-unstable tree with the vfs-brauner-fixes tree Mark Brown
@ 2026-11-16 21:42 ` Sasha Levin
2026-11-16 21:51 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2026-11-16 21:42 UTC (permalink / raw)
To: Mark Brown
Cc: Andrew Morton, Christian Brauner, Yongxin Yang, linux-kernel,
linux-next
Commit 944b8062bc6f ("profiling: report it when /proc/profile can't be
created") in the vfs-brauner-fixes tree and commit 091be6dce28a
("perf/profile: report failure to create /proc/profile") in the
mm-nonmm-unstable tree both make create_proc_profile() return -ENOMEM
when proc_create() fails. The second one also prints an error, as the
return value of an initcall is not shown to anyone. The merge resolution
took the first version, so the message is gone.
Keep the pr_err().
Fixes: ac8dc2166a3c ("Merge branch 'mm-nonmm-unstable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm")
Link: https://lore.kernel.org/all/avsnCFn0jCvbhtRw@sirena.org.uk/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
To be folded into the mm-nonmm-unstable merge, ac8dc2166a3c in next-20261116.
kernel/profile.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/profile.c b/kernel/profile.c
index c6d5a2638a52e..818098cc094a5 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -245,8 +245,10 @@ int __ref create_proc_profile(void)
return 0;
entry = proc_create("profile", S_IWUSR | S_IRUGO,
NULL, &profile_proc_ops);
- if (!entry)
+ if (!entry) {
+ pr_err("profile: failed to create /proc/profile\n");
return -ENOMEM;
+ }
proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t));
return 0;
}
base-commit: 749a4de370409464cf8501ec5b2451df45c84eb4
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH linux-next] profiling: keep the error message in the mm-nonmm-unstable merge
2026-11-16 21:42 ` [PATCH linux-next] profiling: keep the error message in the mm-nonmm-unstable merge Sasha Levin
@ 2026-11-16 21:51 ` Andrew Morton
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2026-11-16 21:51 UTC (permalink / raw)
To: Sasha Levin
Cc: Mark Brown, Christian Brauner, Yongxin Yang, linux-kernel,
linux-next
On Mon, 16 Nov 2026 16:42:19 -0500 Sasha Levin <sashal@kernel.org> wrote:
> Commit 944b8062bc6f ("profiling: report it when /proc/profile can't be
> created") in the vfs-brauner-fixes tree and commit 091be6dce28a
> ("perf/profile: report failure to create /proc/profile") in the
> mm-nonmm-unstable tree both make create_proc_profile() return -ENOMEM
> when proc_create() fails.
Yeah, two near-identical patches were in flight at the same time. I've
dropped 091be6dce28a.
> The second one also prints an error, as the
> return value of an initcall is not shown to anyone.
Unless they use initcall_debug.
> The merge resolution
> took the first version, so the message is gone.
>
> Keep the pr_err().
OK, this turns 944b8062bc6f into 091be6dce28a, ack.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-16 21:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 15:53 linux-next: manual merge of the mm-nonmm-unstable tree with the vfs-brauner-fixes tree Mark Brown
2026-11-16 21:42 ` [PATCH linux-next] profiling: keep the error message in the mm-nonmm-unstable merge Sasha Levin
2026-11-16 21:51 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox