linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Jens Axboe <axboe@kernel.dk>, linux-fsdevel@vger.kernel.org
Cc: brauner@kernel.org, linux-kernel@vger.kernel.org,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH 2/4] timerfd: convert to ->read_iter()
Date: Thu, 11 Apr 2024 13:40:47 +0200	[thread overview]
Message-ID: <528e184b-9cb1-40a7-b757-db11a852dd59@samsung.com> (raw)
In-Reply-To: <1a1c00fb-c83f-44e7-bc6a-cfe52d780c35@kernel.dk>

Hi,

On 11.04.2024 00:27, Jens Axboe wrote:
> On 4/9/24 9:22 AM, Jens Axboe wrote:
>> @@ -312,8 +313,8 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
>>   		ctx->ticks = 0;
>>   	}
>>   	spin_unlock_irq(&ctx->wqh.lock);
>> -	if (ticks)
>> -		res = put_user(ticks, (u64 __user *) buf) ? -EFAULT: sizeof(ticks);
>> +	if (ticks && !copy_to_iter_full(&ticks, sizeof(ticks), to))
>> +		res = -EFAULT;
>>   	return res;
>>   }
> Dumb thinko here, as that should be:
>
> if (ticks) {
> 	res = copy_to_iter(&ticks, sizeof(ticks), to);
> 	if (!res)
> 		res = -EFAULT;
> }
>
> I've updated my branch, just a heads-up. Odd how it passing testing,
> guess I got stack lucky...

The old version got its way into today's linux-next and bisecting the 
boot issues directed me here. There is nothing more to report, but I can 
confirm that the above change indeed fixes the problems observed on 
next-20240411.

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

I hope that tomorrow's linux-next will have the correct version of this 
patch.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


  parent reply	other threads:[~2024-04-11 11:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 15:22 [PATCHSET v3 0/3] Convert fs drivers to ->read_iter() Jens Axboe
2024-04-09 15:22 ` [PATCH 1/4] iov_iter: add copy_to_iter_full() Jens Axboe
2024-04-09 17:06   ` Al Viro
2024-04-09 17:10     ` Jens Axboe
2024-04-09 15:22 ` [PATCH 2/4] timerfd: convert to ->read_iter() Jens Axboe
2024-04-10 22:27   ` Jens Axboe
     [not found]     ` <CGME20240411114048eucas1p21707a2d0bfb9c5a21f3e8aa76c0d82c1@eucas1p2.samsung.com>
2024-04-11 11:40       ` Marek Szyprowski [this message]
2024-04-11 16:32         ` Jens Axboe
2024-04-09 15:22 ` [PATCH 3/4] userfaultfd: " Jens Axboe
2024-04-09 15:22 ` [PATCH 4/4] signalfd: " Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=528e184b-9cb1-40a7-b757-db11a852dd59@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).