On Thu, Jan 16, 2020 at 08:28:56AM -0800, Christoph Hellwig wrote: > > error = xfs_buf_find(target, map, nmaps, flags, NULL, &bp); > > - > > switch (error) { > > case 0: > > /* cache hit */ > > goto found; > > - case -EAGAIN: > > - /* cache hit, trylock failure, caller handles failure */ > > - ASSERT(flags & XBF_TRYLOCK); > > - return NULL; > > case -ENOENT: > > /* cache miss, go for insert */ > > break; > > + case -EAGAIN: > > + /* cache hit, trylock failure, caller handles failure */ > > + ASSERT(flags & XBF_TRYLOCK); > > + /* fall through */ > > case -EFSCORRUPTED: > > default: > > - /* > > - * None of the higher layers understand failure types > > - * yet, so return NULL to signal a fatal lookup error. > > - */ > > - return NULL; > > + return error; > > I think two little if statements would be cleaner with two ifs instead > of the switch statement: > > if (!error) > goto found; > if (error != -ENOENT) > return error; > > Otherwise looks good: Will fix. --D > Reviewed-by: Christoph Hellwig <hch@xxxxxx>