lkml.org 
[lkml]   [2021]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs: make d_path-like functions all have unsigned size
On Tue, Jul 27, 2021 at 04:07:47PM +0100, Matthew Wilcox wrote:

> umm ... what if someone passes in -ENOMEM as buflen? Not saying we
> have such a path right now, but I could imagine it happening.
>
> if (unlikely(buflen < 0))
> return ERR_PTR(buflen);
> if (unlikely(buflen > 0x8000)) {
> buf += buflen - 0x8000;
> buflen = 0x8000;
> }

Not really. You don't want ERR_PTR() of random negative numbers to start
flying around...

\
 
 \ /
  Last update: 2021-07-27 17:18    [W:0.047 / U:1.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site