Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3591131ybe; Sun, 15 Sep 2019 19:36:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyP6r2zNLw5HaI20RgITbGmdVrVNrdw0s2PS+dS5UK4Eg+JJj43mq41tf8LCNzoGdMn0sGw X-Received: by 2002:a17:906:4c4c:: with SMTP id d12mr8357685ejw.174.1568601411627; Sun, 15 Sep 2019 19:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568601411; cv=none; d=google.com; s=arc-20160816; b=IfJR9xiX1kGv2VXZi3+XeeGP0Q4+9aR2+x8q2xS+wJaCogFpo+liTUn9p+fy6rmZTd aNMVbg4MlI11jq7kKBS6dqrMMGygQCBU/Ad1kUK1tneCISf/FPQuD2RvnrOcjh2yYFNJ zo7LVB4AAx4LvKE+fkEek2ar5ybCxQBJCk3myTT4jkdngIrwcNN6L++IsZRVs3vNwK7S 49ps2yKfOWvEutjGulswrWRYlqiFHMYqNzw5NAYYL+K4BjUSHYpA/ryF7MBRL9bqPuAn /Zst++c8bro+CTHcgQGRC2OlteftW4cmJ3eTsyh8cCX8ZU8i+vo17T2JWHxxDZFzxfNP KuDQ== 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=GS95+I7l6t2cnFmyaYBHv+TPqouZXhA9PUIz69mjqOw=; b=NBm37ftoMK+8bovb1s1reUDhNei98RN/HuQ3v+uzW2dYhQOPZC2JLevnWICuDbSivI c4sc+s4l5MfthanjwVdQVonltIkmygPrK955xCK9KUHbeu35kgP+QIw5JyOTqA0sTzSV qHV8JZWAW4SZ9RixCm+t4pR/KXXMYaHBb+S3iVjZmNaB9ZVtr/aVTQy8+Ck/Z+UDj/aa PtmgBA1f5NoCGgn6EfypiYFA4zuCq8gIe+C7UFzk5EdyftxXbHqGJXdb4cVKtFeK9QKw 4Y1STwpa2jrS0CkGHYB5g5ikw1SLUpu0b+ARkdsJKW/8mY9XRUphw33Vz2tCTVKQ77zV Bg6A== 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 jz3si12586623ejb.60.2019.09.15.19.36.21; Sun, 15 Sep 2019 19:36:51 -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 S1728987AbfIPBQb (ORCPT + 99 others); Sun, 15 Sep 2019 21:16:31 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:41104 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728981AbfIPBQb (ORCPT ); Sun, 15 Sep 2019 21:16:31 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 909C6D44EE01C4B61374; Mon, 16 Sep 2019 09:16:29 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.211) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 16 Sep 2019 09:16:28 +0800 Subject: Re: [PATCH 3/3] f2fs: fix inode rwsem regression To: Jaegeuk Kim , Goldwyn Rodrigues CC: , , , , , , , , Goldwyn Rodrigues References: <20190911093926.pfkkx25mffzeuo32@alap3.anarazel.de> <20190911164517.16130-1-rgoldwyn@suse.de> <20190911164517.16130-4-rgoldwyn@suse.de> <20190913194641.GA72768@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: <624dcdc9-db6b-d6dd-6df4-b175c1455dc7@huawei.com> Date: Mon, 16 Sep 2019 09:16:17 +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: <20190913194641.GA72768@jaegeuk-macbookpro.roam.corp.google.com> 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/14 3:46, Jaegeuk Kim wrote: > https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=ebef4d7eda0d06a6ab6dc0f9e9f848276e605962 Reviewed-by: Chao Yu Thanks, > > Merged. Thanks, > > On 09/11, 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; >> - } >> - >> - 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); >> } >> >> -- >> 2.16.4 > . >