Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1827254ybe; Wed, 11 Sep 2019 23:32:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/B50vPQEK1+i2vEOrUNir4jR/BphSunQRfwGc132xk5KagVLMCs5YGMiJVAfOETmYVREG X-Received: by 2002:a05:6402:2039:: with SMTP id ay25mr40047794edb.273.1568269963317; Wed, 11 Sep 2019 23:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568269963; cv=none; d=google.com; s=arc-20160816; b=EUuIJjpvSjjFGQhCn72BEcU5+M56/JZWyXeOgS4uFdb+/6zNV+6OZCJ0O9JC+4K4FE 4EQljVpHq4EmxI5PyDHG7TXvTMmE8glqqFTXRfb/3AkkVxVhz98dvKpBKVIVwL9pIpE1 1gFgq1tSYrjLkbKFo4nCZR/yLuHDrO6/SPHMXQY3nCUImQUoMUcwuSoHDMDd7tZmgfzu R4vySg/LD2n/dv+sgJIJmclLUfcONbjUSz/rl6Cyo1kcLN2Bm2M99h73H3l7ZpL3WdA2 /FKr1DYgVscVO2KbpWLs+bn2+zSLjuvSMDRC8CtEZ8BV4OEgcBk01l5KrwsFoBdxKaV+ 3gBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=eT0j4rFoL95cw1Yc4Td3KWzjofxI+Qe43nrwlq8s+64=; b=k5moTYp3Jg9rkQ2DBPC4Hj9sEIIBxEyawLOEXLw2gS6M1hEOqWyyIrH5k5ypLwrSD6 S7PMJZPuiRbhTlFp3bpEGenJT11Ut+TGU+DOL7WgdDqPcFcajokcS86KE8rVt+b5MwEa AzqeDMkURP9eWonsZ4GY7Q93Od/8NsHvLi8xk7vfnVBRDY1lxd38+LFOiGVc3M6d+U+c Ug/8+HAgCGA2pP8wb1gceMZNCOZLfLcPOhCHsh5H4UkIoSWHGs1IuaQhQxpAGAMzZ4+M el6ZAXnRCaYbYNM25KAFva6e2dWni8KWbFh1P9KTfJgPDPdXdT7BGgcul038vfIEMocX 0bZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si16156318eda.8.2019.09.11.23.32.07; Wed, 11 Sep 2019 23:32:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbfILGRm (ORCPT + 99 others); Thu, 12 Sep 2019 02:17:42 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:55014 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725775AbfILGRm (ORCPT ); Thu, 12 Sep 2019 02:17:42 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4F5231408ADFCDD35F6B; Thu, 12 Sep 2019 14:17:35 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.212) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Sep 2019 14:17:33 +0800 Subject: Re: [PATCH 3/3] f2fs: fix inode rwsem regression To: Goldwyn Rodrigues , CC: , , , , , , , "Goldwyn Rodrigues" References: <20190911093926.pfkkx25mffzeuo32@alap3.anarazel.de> <20190911164517.16130-1-rgoldwyn@suse.de> <20190911164517.16130-4-rgoldwyn@suse.de> From: Chao Yu Message-ID: <77bec57d-2bd1-db40-917e-7dccb58cb3b7@huawei.com> Date: Thu, 12 Sep 2019 14:17:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190911164517.16130-4-rgoldwyn@suse.de> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 2019/9/12 0:45, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > This is similar to 942491c9e6d6 ("xfs: fix AIM7 regression") > Apparently our current rwsem code doesn't like doing the trylock, then > lock for real scheme. So change our read/write methods to just do the > trylock for the RWF_NOWAIT case. > > We don't need a check for IOCB_NOWAIT and !direct-IO because it > is checked in generic_write_checks(). > > Fixes: b91050a80cec ("f2fs: add nowait aio support") > Signed-off-by: Goldwyn Rodrigues > --- > fs/f2fs/file.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > index 3e58a6f697dd..c6f3ef815c05 100644 > --- a/fs/f2fs/file.c > +++ b/fs/f2fs/file.c > @@ -3134,16 +3134,12 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) > goto out; > } > > - if ((iocb->ki_flags & IOCB_NOWAIT) && !(iocb->ki_flags & IOCB_DIRECT)) { > - ret = -EINVAL; > - goto out; > - } We have removed above redundant check, could you rebase to dev-test branch of Jaegeuk's git tree? Otherwise it looks good to me. Thanks, > - > - if (!inode_trylock(inode)) { > - if (iocb->ki_flags & IOCB_NOWAIT) { > + if (iocb->ki_flags & IOCB_NOWAIT) { > + if (!inode_trylock(inode)) { > ret = -EAGAIN; > goto out; > } > + } else { > inode_lock(inode); > } > >