Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2123220ybl; Tue, 3 Dec 2019 19:15:53 -0800 (PST) X-Google-Smtp-Source: APXvYqz8oevFC2RUTLHjpkjCb9zZ8R0i7cQepjGHmrrDCihtlPFpqyCiVs9gW6mlEaRC3N+oXVEH X-Received: by 2002:aca:1811:: with SMTP id h17mr872277oih.159.1575429353218; Tue, 03 Dec 2019 19:15:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575429353; cv=none; d=google.com; s=arc-20160816; b=PHPR8l25/EaTgkF7L3Hr4rdghmdoPTjJvQ+rTRQYBUJDgbizVnFL05wPKIDJk68CeS plNsCjqvOVk1uJWxoDhADtGs/WDfhfNct0XUF0vDoja9g+FORI0QF5+0BMNf87+20r8Z 19Aj/VOXks9sNbwQ7heGOdU+4GFyFZauxSifduCbzNyb/4OFhQc8YM9QYICvSwZ1yyFG 5lXM3wYLqaxzBXBibt3Hnaeg0XpaUgsZp7S5CNQfGwTyn2EN0VoIOD8LEX5eQlLHK/eD irEMUP6wjDLSyIevt4HLU87BVmUHgxPnd4qXzfRgcYaLs2TdcZTRpyaddgzYTe+OEWXm 0LUA== 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=Ko1s3j0kY5P1CkWoMbeSXb5fRz6Ic6aIUzv40p62HCs=; b=sSP2VhstsGzGYdgvA7WwCVIsa7nKnsvcsUkZPLriP822Ggcokmo2eFV/UzBfuaW6hy fldXYhlF1fUFuqN6U447bYIk+9EfC84zhPpeNHMx0Sk81iIrJIMmAIDhSfpYmCnpb7RH gv54u6pTM9c0MMqE9M/zEumHK0H4YGGWLyXVtrG7b2wllgfs9Cxm0W8teuPsExjPiPoK avf+Ge1DDAlt3RGDmkd7SX0d9RSB3co9FAPbuxXsNjHmpByEWiWfGUZJH8boVk9A2cyU fs0ydXFbCQVIbh+v5RTqFAnl7YDA30KQ0cdwzH58h8WNzYnPtWIMT0AAi6uJzHjPOBDw BG1A== 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 g43si2606323otg.223.2019.12.03.19.15.39; Tue, 03 Dec 2019 19:15:53 -0800 (PST) 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 S1726949AbfLDDOx (ORCPT + 99 others); Tue, 3 Dec 2019 22:14:53 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:48376 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726804AbfLDDOx (ORCPT ); Tue, 3 Dec 2019 22:14:53 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 885B553BE6C41356A36B; Wed, 4 Dec 2019 11:14:48 +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; Wed, 4 Dec 2019 11:14:38 +0800 Subject: Re: [PATCH] erofs: zero out when listxattr is called with no xattr To: Gao Xiang , CC: LKML , David Michael , Miao Xie , Fang Wei , Wang Li , Gao Xiang , References: <20191201084040.29275-1-hsiangkao.ref@aol.com> <20191201084040.29275-1-hsiangkao@aol.com> From: Chao Yu Message-ID: <947ae429-d206-0859-ee5b-9bd37f7fd72b@huawei.com> Date: Wed, 4 Dec 2019 11:14:37 +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: <20191201084040.29275-1-hsiangkao@aol.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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/1 16:40, Gao Xiang wrote: > From: Gao Xiang > > As David reported [1], ENODATA returns when attempting > to modify files by using EROFS as a overlayfs lower layer. > > The root cause is that listxattr could return unexpected > -ENODATA by mistake for inodes without xattr. That breaks > listxattr return value convention and it can cause copy > up failure when used with overlayfs. > > Resolve by zeroing out if no xattr is found for listxattr. > > [1] https://lore.kernel.org/r/CAEvUa7nxnby+rxK-KRMA46=exeOMApkDMAV08AjMkkPnTPV4CQ@mail.gmail.com > Fixes: cadf1ccf1b00 ("staging: erofs: add error handling for xattr submodule") > Cc: # 4.19+ > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,