From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750940AbdETEJt (ORCPT ); Sat, 20 May 2017 00:09:49 -0400 Received: from imap.thunk.org ([74.207.234.97]:45042 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbdETEJs (ORCPT ); Sat, 20 May 2017 00:09:48 -0400 Date: Sat, 20 May 2017 00:09:43 -0400 From: "Theodore Ts'o" To: Tahsin Erdogan Cc: Michal Hocko , Jan Kara , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] jbd2: preserve original nofs flag during journal restart Message-ID: <20170520040943.kf4sy4ssixoz7coo@thunk.org> Mail-Followup-To: Theodore Ts'o , Tahsin Erdogan , Michal Hocko , Jan Kara , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170518093939.GD9084@quack2.suse.cz> <20170518162850.7618-1-tahsin@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170518162850.7618-1-tahsin@google.com> User-Agent: NeoMutt/20170113 (1.7.2) 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 On Thu, May 18, 2017 at 09:28:50AM -0700, Tahsin Erdogan wrote: > When a transaction starts, start_this_handle() saves current > PF_MEMALLOC_NOFS value so that it can be restored at journal stop time. > Journal restart is a special case that calls start_this_handle() without > stopping the transaction. start_this_handle() isn't aware that the > original value is already stored so it overwrites it with current value. > > For instance, a call sequence like below leaves PF_MEMALLOC_NOFS flag set > at the end: > > jbd2_journal_start() > jbd2__journal_restart() > jbd2_journal_stop() > > Make jbd2__journal_restart() restore the original value before calling > start_this_handle(). > > Fixes: 81378da64de6 ("jbd2: mark the transaction context with the scope GFP_NOFS context") > Signed-off-by: Tahsin Erdogan > Reviewed-by: Jan Kara Thanks, applied. - Ted