On Thu, Mar 21, 2013 at 09:35:33AM -0700, Kent Overstreet wrote:
> The usage of ctx->dead was fubar - it makes no sense to explicitly check
> it all over the place, especially when we're already using RCU.
> 
> Now, ctx->dead only indicates whether we've dropped the initial
> refcount. The new teardown sequence is:
> set ctx->dead
> hlist_del_rcu();
> synchronize_rcu();
> 
> Now we know no system calls can take a new ref, and it's safe to drop
> the initial ref:
> put_ioctx();
> 
> We also need to ensure there are no more outstanding kiocbs.  This was
> done incorrectly - it was being done in kill_ctx(), and before dropping
> the initial refcount.  At this point, other syscalls may still be
> submitting kiocbs!
> 
> Now, we cancel and wait for outstanding kiocbs in free_ioctx(), after
> kioctx->users has dropped to 0 and we know no more iocbs could be
> submitted.
> 
> Signed-off-by: Kent Overstreet <[email protected]>
> Cc: Zach Brown <[email protected]>
> Cc: Felipe Balbi <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Mark Fasheh <[email protected]>
> Cc: Joel Becker <[email protected]>
> Cc: Rusty Russell <[email protected]>
> Cc: Jens Axboe <[email protected]>
> Cc: Asai Thambi S P <[email protected]>
> Cc: Selvan Mani <[email protected]>
> Cc: Sam Bradshaw <[email protected]>
> Cc: Jeff Moyer <[email protected]>
> Cc: Al Viro <[email protected]>
> Cc: Benjamin LaHaise <[email protected]>
> Cc: Theodore Ts'o <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>

Reviewed-by: "Theodore Ts'o" <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to