From patchwork Mon Aug 8 09:18:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangaihua1@huawei.com X-Patchwork-Id: 9267229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DBF7C60754 for ; Mon, 8 Aug 2016 09:13:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC72226242 for ; Mon, 8 Aug 2016 09:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0E6727D5D; Mon, 8 Aug 2016 09:13:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5429326242 for ; Mon, 8 Aug 2016 09:13:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752008AbcHHJM6 (ORCPT ); Mon, 8 Aug 2016 05:12:58 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:13579 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbcHHJM5 (ORCPT ); Mon, 8 Aug 2016 05:12:57 -0400 Received: from 172.24.1.137 (EHLO szxeml425-hub.china.huawei.com) ([172.24.1.137]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CGA50969; Mon, 08 Aug 2016 17:12:41 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml425-hub.china.huawei.com (10.82.67.180) with Microsoft SMTP Server id 14.3.235.1; Mon, 8 Aug 2016 17:12:32 +0800 From: To: , , CC: Aihua Zhang Subject: [PATCH] ovl: whiteout of lower dir should't dispaly in merge dir. Date: Mon, 8 Aug 2016 17:18:42 +0800 Message-ID: <1470647922-23721-1-git-send-email-zhangaihua1@huawei.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.57A84D15.00A7, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0f3db135a6b998e6313dd52e45e2db9f Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Aihua Zhang mount -t overlay overlay -olowerdir=/lower,upperdir=/upper,workdir=/workdir /merge ls /lower/test_dir whiteout ls /merge/test_dir whiteout ------should't display here this patch fixed it. Signed-off-by: Aihua Zhang --- fs/overlayfs/readdir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index cf37fc7..21cd5a4 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -362,7 +362,7 @@ static int ovl_iterate(struct file *file, struct dir_context *ctx) if (!ctx->pos) ovl_dir_reset(file); - if (od->is_real) + if ((od->is_real) && (od->is_upper)) return iterate_dir(od->realfile, ctx); if (!od->cache) {