From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f170.google.com ([209.85.223.170]:57044 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932790AbdJQOnp (ORCPT ); Tue, 17 Oct 2017 10:43:45 -0400 Received: by mail-io0-f170.google.com with SMTP id m81so2498817ioi.13 for ; Tue, 17 Oct 2017 07:43:45 -0700 (PDT) Subject: Re: [PATCH] fs: Avoid invalidation in interrupt context in dio_complete() To: Lukas Czerner , Jan Kara Cc: linux-fsdevel@vger.kernel.org, eguan@redhat.com References: <1508231484-30966-1-git-send-email-lczerner@redhat.com> <20171017095356.GQ9762@quack2.suse.cz> <20171017104402.mm45va67ejxtgjta@rh_laptop> From: Jens Axboe Message-ID: Date: Tue, 17 Oct 2017 08:43:43 -0600 MIME-Version: 1.0 In-Reply-To: <20171017104402.mm45va67ejxtgjta@rh_laptop> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 10/17/2017 04:44 AM, Lukas Czerner wrote: > > On Tue, Oct 17, 2017 at 11:53:56AM +0200, Jan Kara wrote: >> On Tue 17-10-17 11:11:24, Lukas Czerner wrote: >>> Currently we try to defer completion of async DIO to the process context >>> in case there are any mapped pages associated with the inode so that we >>> can invalidate the pages when the IO completes. However the check is racy >>> and the pages can be mapped afterwards. If this happens we might end up >>> calling invalidate_inode_pages2_range() in dio_complete() in interrupt >>> context which could sleep. This can be reproduced by generic/451. >>> >>> Fix this by passing the information whether we can or can't invalidate >>> to the dio_complete(). Thanks Eryu Guan for reporting this and Jan Kara >>> for suggesting a fix. >>> >>> Fixes: 332391a9935d ("fs: Fix page cache inconsistency when mixing buffered and AIO DIO") >>> Signed-off-by: Lukas Czerner >>> Reported-by: Eryu Guan >> >> Looks good to me. You can add: >> >> Reviewed-by: Jan Kara >> >> BTW, I guess you should CC someone who can merge the patch... > > Jens, could you please take this through your tree ? Will do, queued it up for 4.14. -- Jens Axboe