From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D06FC4742C for ; Mon, 16 Nov 2020 12:32:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16317206D8 for ; Mon, 16 Nov 2020 12:32:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rvg0OYKh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729434AbgKPLBJ (ORCPT ); Mon, 16 Nov 2020 06:01:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729430AbgKPLBI (ORCPT ); Mon, 16 Nov 2020 06:01:08 -0500 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75ACEC0613CF; Mon, 16 Nov 2020 03:01:08 -0800 (PST) Received: by mail-io1-xd43.google.com with SMTP id m13so16899998ioq.9; Mon, 16 Nov 2020 03:01:08 -0800 (PST) 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=KhjOnb4QUN3w0CmSJ2KWQ6YBoBY/KBX+nT1jorDtw8I=; b=rvg0OYKhs9uQFpWyPG+DegNwZpslEgG69iKKf3s8xaBceH3iYmLl1SnYSxRlX+HkSM wjrdDeqgifiTRhK/XSUWtYKJB11AN2+kiyMVupDO435P6QFHnYcRZgUjMN4dvqD1R8KZ RZdPrupZ/dxoJthV8WfT5Pc0cKdZetraIiW8PbRbCfrb4sjalO3MyiBGlCS9gQ31jvLy 5kU7c78tbIuyJYUdTXG9pKSS9iCko5f6SwYYbRCRcQaNFJOeuiPkI9Wlit9EjVP6OXTf V69T7udtVCRAwesi7kY9Pk8Afebevh5ccuZaAQxBo+YEAQRuIQ9+2kF9FwhG4aJWyA6O y+mA== 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=KhjOnb4QUN3w0CmSJ2KWQ6YBoBY/KBX+nT1jorDtw8I=; b=Jw5C999lSUGeK40qmZyqXSP4g7/1BG5oo8LRsrCpNAS0DCtuXWev0nid9M2coVY1co ZuiFCwwXkvX5S7qnfA8ei2MeD4yHAoKtrS636eiJ6ISm/qlzMMpiLdj8CSN56hfrZCZK LCV3rjkAJcCkMPHSIYdO+GJem+vCxBOAmknyqnltn/i2dqsiB3nEOyxrtfv3YzfARd/A Q6xO/uO/DjRZr43ZmZKk8mcv4JILeh9PYXL4b3bnCgAoytHrFqJQfc+bN/iFjjAWIQal M7gbZO+WMYyTlRSwzqzkaIdZGw9O6JwbC86L0XXlf8lZHIyIQfOGbYXHitZxdYbGZAXY afaQ== X-Gm-Message-State: AOAM530udsNmZIxQjNVCJFpOC+IkZ1bKytjxMWlQy/5NmUnoQZFdMdIL g+V92Fq5HH6tiR9sAQy0bJtZOsgFyuNccnEP85w= X-Google-Smtp-Source: ABdhPJyy3Ne/vQSURiy0qN2Iy4vLG0JPTwFkGD7Y8gBYmhHYgg/dF3ZYlvSAxDPnHWaWyjkrCdcYhgRbJ68X0VD1oQ0= X-Received: by 2002:a02:883:: with SMTP id 125mr10148700jac.30.1605524467747; Mon, 16 Nov 2020 03:01:07 -0800 (PST) MIME-Version: 1.0 References: <20201116045758.21774-1-sargun@sargun.me> <20201116045758.21774-3-sargun@sargun.me> In-Reply-To: <20201116045758.21774-3-sargun@sargun.me> From: Amir Goldstein Date: Mon, 16 Nov 2020 13:00:56 +0200 Message-ID: Subject: Re: [RFC PATCH 2/3] overlay: Add ovl_do_getxattr helper To: Sargun Dhillon Cc: overlayfs , Miklos Szeredi , Alexander Viro , Giuseppe Scrivano , Vivek Goyal , Daniel J Walsh , David Howells , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-unionfs@vger.kernel.org On Mon, Nov 16, 2020 at 6:58 AM Sargun Dhillon wrote: > > We already have a helper for getting xattrs from inodes, namely > ovl_getxattr, but it doesn't allow for copying xattrs onto the current > stack. In addition, it is not instrumented like the rest of the helpers. > > Signed-off-by: Sargun Dhillon > Cc: linux-fsdevel@vger.kernel.org > Cc: linux-unionfs@vger.kernel.org > Cc: Miklos Szeredi > Cc: Amir Goldstein > --- > fs/overlayfs/overlayfs.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h > index 29bc1ec699e7..9eb911f243e1 100644 > --- a/fs/overlayfs/overlayfs.h > +++ b/fs/overlayfs/overlayfs.h > @@ -179,6 +179,15 @@ static inline int ovl_do_setxattr(struct dentry *dentry, const char *name, > return err; > } > > +static inline int ovl_do_getxattr(struct dentry *dentry, const char *name, > + void *value, size_t size) > +{ > + int err = vfs_getxattr(dentry, name, value, size); > + pr_debug("getxattr(%pd2, \"%s\", \"%*pE\", %zu) = %i\n", > + dentry, name, min((int)size, 48), value, size, err); > + return err; > +} > + upstream already has this helper. > static inline int ovl_do_removexattr(struct dentry *dentry, const char *name) > { > int err = vfs_removexattr(dentry, name); > -- > 2.25.1 >