From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 26 Feb 2018 08:31:19 -0700 From: Jens Axboe To: Jan Kara Cc: Mark Rutland , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Goldwyn Rodrigues , stable@vger.kernel.org Subject: Re: [PATCH] direct-io: Fix sleep in atomic due to sync AIO Message-ID: <20180226153117.GA764@kernel.dk> References: <20180226115143.24641-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180226115143.24641-1-jack@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: On Mon, Feb 26 2018, Jan Kara wrote: > Commit e864f39569f4 "fs: add RWF_DSYNC aand RWF_SYNC" added additional > way for direct IO to become synchronous and thus trigger fsync from the > IO completion handler. Then commit 9830f4be159b "fs: Use RWF_* flags for > AIO operations" allowed these flags to be set for AIO as well. However > that commit forgot to update the condition checking whether the IO > completion handling should be defered to a workqueue and thus AIO DIO > with RWF_[D]SYNC set will call fsync() from IRQ context resulting in > sleep in atomic. > > Fix the problem by checking directly iocb flags (the same way as it is > done in dio_complete()) instead of checking all conditions that could > lead to IO being synchronous. Thanks, applied. -- Jens Axboe