lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] fs: Add an explicit might_sleep() to iput
On Wed, May 27, 2020 at 9:09 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Wed, May 27, 2020 at 04:17:53PM +0200, KP Singh wrote:
> > From: KP Singh <kpsingh@google.com>
> >
> > It is currently mentioned in the comments to the function that iput
> > might sleep when the inode is destroyed. Have it call might_sleep, as
> > dput already does.
> >
> > Adding an explicity might_sleep() would help in quickly realizing that
> > iput is called from a place where sleeping is not allowed when
> > CONFIG_DEBUG_ATOMIC_SLEEP is enabled as noticed in the dicussion:
>
> You do realize that there are some cases where iput() *is* guaranteed
> to be non-blocking, right?

Yes, but the same could be said about dput too right?

Are there any callers that rely on these cases? (e.g. when the caller is
sure that it's not dropping the last reference to the inode).

- KP

\
 
 \ /
  Last update: 2020-05-27 21:51    [W:0.064 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site