From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srinivas Eeda Subject: Re: [PATCH 1/1] writeback fix bdi thread race in mark_inode_dirty Date: Mon, 22 Jul 2013 10:06:47 -0700 Message-ID: <51ED66A7.3020100@oracle.com> References: <1374257140-26729-1-git-send-email-srinivas.eeda@oracle.com> <20130722154101.GT32755@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, jack@suse.cz To: Jens Axboe Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:24527 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756838Ab3GVRCc (ORCPT ); Mon, 22 Jul 2013 13:02:32 -0400 In-Reply-To: <20130722154101.GT32755@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Jens, Thanks! I am new to submitting patches to linux-fsdevel. Is there a mailing list I should submit this patch or someone will pick this patch for mainline and stable branch? Thanks, --Srini On 07/22/2013 08:41 AM, Jens Axboe wrote: > On Fri, Jul 19 2013, Srinivas Eeda wrote: >> In __mark_inode_dirty, a process checks !wb_has_dirty_io outside of list_lock >> spinlock. This could cause a race, where process sees that list has dirty io >> and decides not wake up bdi thread and waits for spinlock to add to dirty list. >> Right at this time bdi_writeback_workfn finished write-back on last inode. >> It sees the list is empty and ends. Process could now get the spinlock and >> add inode to dirty list and doesn't wakeup bdi thread. Future calls to >> __mark_inode_dirty also do not wake up the thread because list is not empty >> any more. >> >> Fix is to get wb.list_lock spinlock before checking the dirty list > With Jan's ack, lets add this for the current cycle. Should go into > stable as well, imho. >