Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp518297ybd; Wed, 26 Jun 2019 02:05:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8hi1C6ilpvRdUuq6x+Nd7mwfbubucVmL62yDX5iJAaiDpgrEsx+90dwHS5G6imaF1Fgb9 X-Received: by 2002:a63:c34c:: with SMTP id e12mr1823465pgd.195.1561539931347; Wed, 26 Jun 2019 02:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561539931; cv=none; d=google.com; s=arc-20160816; b=zbdTNM5Ds9cpmioFtMj5Ia40xuoocOIdEtcLLSnR0DhiBwnidA9zjCva9Jzt0wlL4U 0CDaKfb+hR/u2kmymbz+bg2drCEvwpStHCNnQMX+srXV2Obcvbn/qDgCPd6kteUQZW8s D1FIaRoJDOq86+4mGMlxbeV9IWwyOIhJvsMuyh57CPQtqsH4Du2h7ZMnBRbvwEtWHv+F xclUVWRFYuv5HTP/2Lyul6lfcJzrrSXbqY+ov3h9K52XQ436e2s/kjWjRRKX94uyluVg qf5l+w5f+edTxnQtXCmp3me5qmiadzhsH9qQjY2UX0aGV1+8TEvPCK/0ATHtNQK45X7C TZBg== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=YbEGwlGsKypnl0pFYrS4YkoUVyc/yllKuRh563bGgtU=; b=PEToPEgfw7Rvb3s5cpz+lTMWFCJcveUbccSrG+KNY7iV+bwNbEc+KwE6iM1uN0fA5y bqniR6G73MtGYTyjGvAxvBqmYzQACeHNbmOpqiK4gyhh+b+O76OynBrpwYziVwXh605G V7bSfgRVtVQ9gGoH8Q09+sygiilOzBWDDcjzTmNU1cah9ILVAy9khSZy8iFQU6cBiDXd pjZOmGW6oIFztxFb+fwdEtN6HBfEjDIC0aBZA7PO//zW/xoFAmMB9p5SkWd6Azh9FPR9 HcfB0GYY8G9firFw1+qWozUj33c3/QByAhk+xcj422AbSD5bo71HBO9RAWZPschaesg1 Jg+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 j95si2843425plb.349.2019.06.26.02.05.14; Wed, 26 Jun 2019 02:05:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbfFZJDi (ORCPT + 99 others); Wed, 26 Jun 2019 05:03:38 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:40480 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726963AbfFZJDi (ORCPT ); Wed, 26 Jun 2019 05:03:38 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 51FC098D895276A11E5E; Wed, 26 Jun 2019 17:03:36 +0800 (CST) Received: from [10.151.23.176] (10.151.23.176) by smtp.huawei.com (10.3.19.212) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Jun 2019 17:02:57 +0800 Subject: Re: [PATCH RESEND] staging: erofs: return the error value if fill_inline_data() fails To: Yue Hu , , CC: , , , , Miao Xie References: <20190626033038.9456-1-zbestahu@gmail.com> From: Gao Xiang Message-ID: Date: Wed, 26 Jun 2019 17:02:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20190626033038.9456-1-zbestahu@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.151.23.176] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yue, On 2019/6/26 11:30, Yue Hu wrote: > From: Yue Hu > > We should consider the error returned by fill_inline_data() when filling > last page in fill_inode(). If not getting inode will be successful even > though last page is bad. That is illogical. Also change -EAGAIN to 0 in > fill_inline_data() to stand for successful filling. > > Signed-off-by: Yue Hu ditto, add the tags from other guyes. Thanks, Gao Xiang > --- > drivers/staging/erofs/inode.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c > index d6e1e16..1433f25 100644 > --- a/drivers/staging/erofs/inode.c > +++ b/drivers/staging/erofs/inode.c > @@ -156,7 +156,7 @@ static int fill_inline_data(struct inode *inode, void *data, > inode->i_link = lnk; > set_inode_fast_symlink(inode); > } > - return -EAGAIN; > + return 0; > } > > static int fill_inode(struct inode *inode, int isdir) > @@ -223,7 +223,7 @@ static int fill_inode(struct inode *inode, int isdir) > inode->i_mapping->a_ops = &erofs_raw_access_aops; > > /* fill last page if inline data is available */ > - fill_inline_data(inode, data, ofs); > + err = fill_inline_data(inode, data, ofs); > } > > out_unlock: >