Message ID | 83ce22b4-bae1-9c97-1ad5-10835d6c5424@kernel.dk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [GIT,PULL] Block driver updates for 5.18-rc1 | expand |
On Fri, Mar 18, 2022 at 2:59 PM Jens Axboe <axboe@kernel.dk> wrote: > > This will throw a merge conflict in drivers/nvme/target/configfs.c, > resolution is just to delete the two discovery helpers and the configfs > attribute, basically everything in the conflict section. This is due to > conflicting with a last minute revert in 5.17. Only because I looked at this conflict did I notice that some of the changes are kind of pointless.. I mean, this is well-meaning, but I'm really not convinced it's actually *useful*: - return sprintf(page, "\n"); + return snprintf(page, PAGE_SIZE, "\n"); It's not like a two-byte copy can ever overflow PAGE_SIZE. Sometimes 'sprintf() -> snprintf()' conversions don't really buy you anything. Linus
The pull request you sent on Fri, 18 Mar 2022 15:59:30 -0600:
> git://git.kernel.dk/linux-block.git tags/for-5.18/drivers-2022-03-18
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/69d1dea852b54eecd8ad2ec92a7fd371e9aec4bd
Thank you!
On 3/21/22 6:13 PM, Linus Torvalds wrote: > On Fri, Mar 18, 2022 at 2:59 PM Jens Axboe <axboe@kernel.dk> wrote: >> >> This will throw a merge conflict in drivers/nvme/target/configfs.c, >> resolution is just to delete the two discovery helpers and the configfs >> attribute, basically everything in the conflict section. This is due to >> conflicting with a last minute revert in 5.17. > > Only because I looked at this conflict did I notice that some of the > changes are kind of pointless.. > > I mean, this is well-meaning, but I'm really not convinced it's > actually *useful*: > > - return sprintf(page, "\n"); > + return snprintf(page, PAGE_SIZE, "\n"); > > It's not like a two-byte copy can ever overflow PAGE_SIZE. > > Sometimes 'sprintf() -> snprintf()' conversions don't really buy you > anything. Yeah agree, that does seem kind of pointless as an isolated change. At least maybe it helps cut down on copy/paste related issues, where someone copies it and changes it to dump more into 'page'.
Hi Linus, On 3/21/22 17:13, Linus Torvalds wrote: > On Fri, Mar 18, 2022 at 2:59 PM Jens Axboe <axboe@kernel.dk> wrote: >> >> This will throw a merge conflict in drivers/nvme/target/configfs.c, >> resolution is just to delete the two discovery helpers and the configfs >> attribute, basically everything in the conflict section. This is due to >> conflicting with a last minute revert in 5.17. > > Only because I looked at this conflict did I notice that some of the > changes are kind of pointless.. > > I mean, this is well-meaning, but I'm really not convinced it's > actually *useful*: > > - return sprintf(page, "\n"); > + return snprintf(page, PAGE_SIZE, "\n"); > > It's not like a two-byte copy can ever overflow PAGE_SIZE. > > Sometimes 'sprintf() -> snprintf()' conversions don't really buy you anything. > > Linus > I did that to keep the code uniform in the drivers/nvme/target/configfs.c. In future will avoid submitting such patches. -ck