Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933071Ab3DBTxS (ORCPT ); Tue, 2 Apr 2013 15:53:18 -0400 Received: from li9-11.members.linode.com ([67.18.176.11]:58599 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761060Ab3DBTxR (ORCPT ); Tue, 2 Apr 2013 15:53:17 -0400 Date: Tue, 2 Apr 2013 15:53:03 -0400 From: "Theodore Ts'o" To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-aio@kvack.org, akpm@linux-foundation.org, Zach Brown , Felipe Balbi , Greg Kroah-Hartman , Mark Fasheh , Joel Becker , Rusty Russell , Jens Axboe , Asai Thambi S P , Selvan Mani , Sam Bradshaw , Jeff Moyer , Al Viro , Benjamin LaHaise , Minchan Kim Subject: Re: [PATCH 30/33] block, aio: batch completion for bios/kiocbs Message-ID: <20130402195303.GB5703@thunk.org> Mail-Followup-To: Theodore Ts'o , Kent Overstreet , linux-kernel@vger.kernel.org, linux-aio@kvack.org, akpm@linux-foundation.org, Zach Brown , Felipe Balbi , Greg Kroah-Hartman , Mark Fasheh , Joel Becker , Rusty Russell , Jens Axboe , Asai Thambi S P , Selvan Mani , Sam Bradshaw , Jeff Moyer , Al Viro , Benjamin LaHaise , Minchan Kim References: <1363883754-27966-1-git-send-email-koverstreet@google.com> <1363883754-27966-31-git-send-email-koverstreet@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1363883754-27966-31-git-send-email-koverstreet@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1131 Lines: 35 On Thu, Mar 21, 2013 at 09:35:51AM -0700, Kent Overstreet wrote: > + if (unlikely(req->ki_eventfd != eventfd)) { > + if (eventfd) { > + /* Make event visible */ > + kioctx_ring_unlock(ctx, tail); > + ctx = NULL; > + > + eventfd_signal(eventfd, 1); > + eventfd_ctx_put(eventfd); > + } I just noticed something else. There's a ring unlock here().... but there isn't a matching ring_lock(), or an exit from the function. Since you've set the ctx to be NULL, then subsequently, aren't we going to crash at the subseqent kioctx_ring_unlock() below.... > + > + eventfd = req->ki_eventfd; > + req->ki_eventfd = NULL; > + } > + > + if (unlikely(req->ki_ctx != ctx)) { > + kioctx_ring_unlock(ctx, tail); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (Or the kioctx_ring_unlock() at the end of this function after the while loop terminates.) - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/