Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp548799pxk; Wed, 23 Sep 2020 09:37:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVHeaz/Ac9ISr7WVS0/84p8vpCVINusOcRX0qIGqB+UxVn5eNEShstT6bYuPFrkacBSpou X-Received: by 2002:a50:ec12:: with SMTP id g18mr121893edr.309.1600879052773; Wed, 23 Sep 2020 09:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600879052; cv=none; d=google.com; s=arc-20160816; b=AYdPXKQ2Y4oDdJHSPd/reS9/twE9VGXNjImITbaT9bqA4jzoTHu5sLKcPDRlUEWn27 KuyNXFTkO6URs6BeoUboCNJ27Wb3BBGYR8BEPDdQWlbCTi7fjMEwSzFooeYa3+ro3YG4 1Ksq21/FhrrbEjJzmMtz1WeKsi2+HyDrnVr82STeuFzR+rRsB4J5DCTLRxOMaYldgW2s CClCoEeA6C3kGo6tRoUxA2ykpqw/TFlUc0YJK3XuexRHKbUw1/6+Xm03l+h5CW91Gvg9 XJQQqwD+w673VpuZpW+Qfkp/2etuVTc5OhUMy0Iwn7F3tB/hvy9xBj29mH+/0WgtMsXZ riNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7kxcMzSJOu9MRUeXMXsPNJHKsz/cSDIqf1ztUHh+hbg=; b=0WDN2HdgP/xMOyuFVbN2DMSKsTHSBAWi1fM7+Mmj3tgMPNbHGUdW5Y0gKaXKdUDVeN qrPiFj+ZgfIIpgO7/v9XSQUb6YVxSRjZpPQ3ETtQFdkCJhvnoLI4mDAm9nph6hIAQA1C dbH6NGamWdfvK2nadqAEHA0ONkbJ7lCSWDpDVEl281BkD1KOYgaDF6MPINyBbqpZOuvw JanlPTkjJNO+2WKgC/792C252Vf0E4sXTk3pmYCCOrVjilOfIqinQEbznOgd49jBXkz3 G/7Ir6xfXMTsj8H3QaFoQObYjkdCbk2+q0kK/rdNkHotgo2twy1x7tAQTZSmzIw97auH SBsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hupGvrAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si225251edr.606.2020.09.23.09.37.08; Wed, 23 Sep 2020 09:37:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hupGvrAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbgIWQgN (ORCPT + 99 others); Wed, 23 Sep 2020 12:36:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgIWQgN (ORCPT ); Wed, 23 Sep 2020 12:36:13 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 798FDC0613CE; Wed, 23 Sep 2020 09:36:13 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id h2so170319ilo.12; Wed, 23 Sep 2020 09:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7kxcMzSJOu9MRUeXMXsPNJHKsz/cSDIqf1ztUHh+hbg=; b=hupGvrAW1PU1XHVqgGlDPNjfWAM6aiQKfO2db0dqqhjlxJIRcm8Qy89a5csCD5aiRZ zRKBSZNSqaOfuQV6rIcv25EqxsRxGo400sWROPMxq92k91eJWUrzPyW40mUjaDlpbC5m vXteF6iQYnDyQCKrzcF3SD3xYpfZ1RrrYI4+B0Ty9d5TPL/fxEERRP8XZ157vSlCidgo lZz8DvkCUmD6EC6x/0kuykVsGPhBx3tHtwVl8v390oAmFai+kQvEL8ZJi9VFHzMvt5md OvH30JveLpQ5/bExiAdX9qC9Z1hp11vSj0ekH5R6owmZyaLD+uvlRp1jtSNflr5nAOgo kUQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7kxcMzSJOu9MRUeXMXsPNJHKsz/cSDIqf1ztUHh+hbg=; b=NNjmLFmdzAfMnQq4KXxx/V2LYwXc9fE4Vm92orZblx9Sv6skkiR0ENKnEaILgp89Yz QxaEntSWYYQVc2VK8y1ccECTHroRv8oymiHr20YKbjuJ3WIeYRu2pRehofvNnwUy3Bex aCfFZtGU9jth7V3GmQGjQQhXDtytmMc1+LfSdr6xZCkx30RgD1umW9V6zyT6ojP9KTfK WgIRtsFWqRv6pRIHEqeAAfYtWO+aComRnBWh0Y39Ekx5VPdero85FoIcVM9Zu0QJE6FQ 9sxHuW092+HDgQ6a6tPn0SbohPNU7nDiTL4zbZMoDBpprbzxtkuCyqmCjZmfb04AhJCz IXfA== X-Gm-Message-State: AOAM5325e8XF4xUMcK2EKbIvM31wGQEZA/LYJuH8+s63BrRz/UNQ19D1 pdaZlQ5oLXnKHBk7smzAaGrksO28UPLqC1OjB7w= X-Received: by 2002:a92:8b41:: with SMTP id i62mr564007ild.9.1600878972555; Wed, 23 Sep 2020 09:36:12 -0700 (PDT) MIME-Version: 1.0 References: <20200923152308.3389-1-ptikhomirov@virtuozzo.com> In-Reply-To: From: Amir Goldstein Date: Wed, 23 Sep 2020 19:36:01 +0300 Message-ID: Subject: Re: [PATCH v2] ovl: introduce new "index=nouuid" option for inodes index feature To: Pavel Tikhomirov Cc: Miklos Szeredi , Vivek Goyal , overlayfs , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > @@ -414,7 +415,7 @@ static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry, > > * Return 0 on match, -ESTALE on mismatch, < 0 on error. > > */ > > static int ovl_verify_fh(struct dentry *dentry, const char *name, > > - const struct ovl_fh *fh) > > + const struct ovl_fh *fh, bool nouuid) > > { > > struct ovl_fh *ofh = ovl_get_fh(dentry, name); > > int err = 0; > > @@ -425,8 +426,14 @@ static int ovl_verify_fh(struct dentry *dentry, const char *name, > > if (IS_ERR(ofh)) > > return PTR_ERR(ofh); > > > > - if (fh->fb.len != ofh->fb.len || memcmp(&fh->fb, &ofh->fb, fh->fb.len)) > > + if (fh->fb.len != ofh->fb.len) { > > err = -ESTALE; > > + } else { > > + if (nouuid && !uuid_equal(&fh->fb.uuid, &ofh->fb.uuid)) > > + ofh->fb.uuid = fh->fb.uuid; > > + if (memcmp(&fh->fb, &ofh->fb, fh->fb.len)) > > + err = -ESTALE; > > + } > > On second thought I am wondering if we should do that differently. If users want to work with index=nouuid, they need to work with it from day 1. index=nouuid should export null uuid in NFS handles and write null uuid in trusted.overlay.origin xattr. So in ovl_encode_real_fh() you set null uuid and instead of relaxing uuid_equal() in ovl_decode_real_fh() you change it to uuid_is_null(). Do you have a problem with that for Virtuozzo use case? Thanks, Amir.