[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c4b7bb2-2b2c-472f-b392-ac75cf482ec0@amd.com>
Date: Thu, 6 Mar 2025 20:56:32 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Oleg Nesterov <oleg@...hat.com>
CC: Linus Torvalds <torvalds@...ux-foundation.org>, Miklos Szeredi
<miklos@...redi.hu>, Alexander Viro <viro@...iv.linux.org.uk>, "Christian
Brauner" <brauner@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
"Hugh Dickins" <hughd@...gle.com>, <linux-fsdevel@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>, Jan Kara
<jack@...e.cz>, "Matthew Wilcox (Oracle)" <willy@...radead.org>, "Mateusz
Guzik" <mjguzik@...il.com>, "Gautham R. Shenoy" <gautham.shenoy@....com>,
Rasmus Villemoes <ravi@...vas.dk>, <Neeraj.Upadhyay@....com>,
<Ananth.narayan@....com>, Swapnil Sapkal <swapnil.sapkal@....com>
Subject: Re: [RFC PATCH 1/3] fs/pipe: Limit the slots in pipe_resize_ring()
Hello Oleg,
On 3/6/2025 5:58 PM, Oleg Nesterov wrote:
> On 03/06, K Prateek Nayak wrote:
>>
>> @@ -1272,6 +1272,10 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
>> struct pipe_buffer *bufs;
>> unsigned int head, tail, mask, n;
>>
>> + /* nr_slots larger than limits of pipe->{head,tail} */
>> + if (unlikely(nr_slots > BIT(BITS_PER_TYPE(pipe_index_t) - 1)))
>
> Hmm, perhaps
>
> if (nr_slots > (pipe_index_t)-1u)
>
> is more clear?
Indeed it is. I didn't even know we could do that! Thank you for
pointing it out.
>
> Oleg.
>
--
Thanks and Regards,
Prateek
Powered by blists - more mailing lists