linux-next: manual merge of the fs-next tree with the mm-nonmm-unstable tree
Mark Brown
maintainerHi all,
Today's linux-next merge of the fs-next tree got a conflict in:
kernel/profile.c
between commits:
2ab6daee3c87d ("profile: account for partial /proc/profile reads") 0ff0b873d4d93 ("profile: simplify /proc/profile read layout")
from the mm-nonmm-unstable tree and commit:
79011a80f0646 ("proc: give kcore, kmsg, the kpage files and profile their own file_operations")
from the fs-next tree. This essentially discards Andrew's changes, AIUI the conversion to the iterator API ought to achieve roughly the same thing though I may be misunderstanding. I may also have messed up the merge somewhere.
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.
kernel/profile.c +0 -0
@@@ -150,55 -150,31 +150,28 @@@ void profile_tick(int type* buffer. Use of the program readprofile is recommended in order to * get meaningful info out of these data. */ -static ssize_t -read_profile (struct file *file,char __user *buf,size_t count,loff_t *ppos) +static ssize_t read_profile (struct kiocb *iocb,struct iov_iter *to) { -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; +unsigned long p = iocb->ki_pos; +size_t count =iov_iter_count (to); +ssize_t read; +char *pnt; +unsigned int sample_step = (unsigned int )(1UL << prof_shift); - if (p >= (prof_len+1)*sizeof(unsigned int)) - return 0; - if (count > (prof_len+1)*sizeof(unsigned int) - p) - count = (prof_len+1 )*sizeof (unsigned int ) - p; - read =0 ; +/* 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 ; - pos = offset; - count =min (count, file_size - pos); - -/* 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; +while (p <sizeof (unsigned int ) && count >0 ) { +if (copy_to_iter ((char *)(&sample_step)+p,1 , to) !=1 ) +return -EFAULT ; + p++; count--; read++; } - -/* 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) + pnt = (char *)prof_buffer + p -sizeof (atomic_t); +if (copy_to_iter (pnt, count, to) != count)return -EFAULT ; -return done; + read += count; + iocb->ki_pos += read; +return read; }/* default is to not implement this call */
Quoted 11 lines · On Tue, 17 Nov 2026 16:17:01 +0000 Mark Brown <[email protected]> wrote:
Hi all,
Today's linux-next merge of the fs-next tree got a conflict in:
kernel/profile.cbetween commits:
2ab6daee3c87d("profile: account for partial/proc/profilereads")0ff0b873d4d93("profile: simplify/proc/profileread layout")
Quoted 8 lines
from the mm-nonmm-unstable tree and commit:
79011a80f0646("proc: give kcore, kmsg, the kpage files and profile their ownfile_operations")from the fs-next tree. This essentially discards Andrew's changes, AIUI the conversion to the iterator API ought to achieve roughly the same thing though I may be misunderstanding. I may also have messed up the merge somewhere.
OK, thanks, I'll make those two go away for now, will take another look in the next -rc cycle.
Quoted 2 lines · Andrew Morton
OK, thanks, I'll make those two go away for now, will take another look in the next -rc cycle.
Hi Mark,
Andrew's two patches are gone from mm-nonmm-unstable, but every next tag since next-20261118 still has their read_profile(). The fs-next merge applies "profile: Fix up merge" and "profile: More merge fixup", and those put it back on top of the iov_iter conversion.
Without the two fixups, the merge leaves read_profile() as it is in 79011a80f064 ("proc: give kcore, kmsg, the kpage files and profile their own file_operations").
Signature · 2 lines
Thanks, Sasha
Mark Brown
maintainerQuoted 8 lines · Sasha Levin
Andrew's two patches are gone from mm-nonmm-unstable, but every next tag since next-20261118 still has their
read_profile(). The fs-next merge applies "profile: Fix up merge" and "profile: More merge fixup", and those put it back on top of theiov_iterconversion.Without the two fixups, the merge leaves
read_profile()as it is in79011a80f064("proc: give kcore, kmsg, the kpage files and profile their ownfile_operations").
Now dropped.