From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:54164 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755268AbcEWMB4 (ORCPT ); Mon, 23 May 2016 08:01:56 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E09E64085 for ; Mon, 23 May 2016 12:01:55 +0000 (UTC) Date: Mon, 23 May 2016 14:01:50 +0200 From: Carlos Maiolino To: linux-fsdevel@vger.kernel.org Cc: vgoyal@redhat.com Subject: Re: [PATCH] overlayfs: Do d_type check only if work dir creation was successful Message-ID: <20160523120150.GB21456@redhat.com> References: <20160520130426.GA31667@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160520130426.GA31667@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Vivek. On Fri, May 20, 2016 at 09:04:26AM -0400, Vivek Goyal wrote: > d_type check requires successful creation of workdir as iterates > through work dir and expects work dir to be present in it. If that's > not the case, this check will always return d_type not supported even > if underlying filesystem might be supporting it. > ovl_check_d_type_supported, will call iterate_dir(), which is supposed to return -ENOENT if the work dir is not present AFAICT, isn't that enough to detect if work dir is present and handle it accordingly? I recently started to learn overlay code, so my apologies if my above comment is not true. Cheers > So don't do this check if work dir creation failed in previous step. > > Signed-off-by: Vivek Goyal > --- > fs/overlayfs/super.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c > index 791235e..48234425 100644 > --- a/fs/overlayfs/super.c > +++ b/fs/overlayfs/super.c > @@ -1064,16 +1064,19 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) > /* > * Upper should support d_type, else whiteouts are visible. > * Given workdir and upper are on same fs, we can do > - * iterate_dir() on workdir. > + * iterate_dir() on workdir. This check requires successful > + * creation of workdir in previous step. > */ > - err = ovl_check_d_type_supported(&workpath); > - if (err < 0) > - goto out_put_workdir; > + if (ufs->workdir) { > + err = ovl_check_d_type_supported(&workpath); > + if (err < 0) > + goto out_put_workdir; > > - if (!err) { > - pr_err("overlayfs: upper fs needs to support d_type.\n"); > - err = -EINVAL; > - goto out_put_workdir; > + if (!err) { > + pr_err("overlayfs: upper fs needs to support d_type.\n"); > + err = -EINVAL; > + goto out_put_workdir; > + } > } > } > > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Carlos