Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3785636pxf; Mon, 29 Mar 2021 11:18:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpyZ14IiSQyEujvZAe1TmNVvq3N6hCYsPo+8Td6mGYf3sQbYNnn3k0LCi4t3HUHDYmVbzD X-Received: by 2002:a17:906:1c98:: with SMTP id g24mr29865947ejh.51.1617041928604; Mon, 29 Mar 2021 11:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617041928; cv=none; d=google.com; s=arc-20160816; b=E195vKOWwBMMKcfMhytbGREaYx1WrljHR5em3y7aE+7ehgAkePoNTozjtaG5gT/xsf OtRB6sM/wJ7ps6a7TlFHP1+dgBmXQ74H31wIyxGav0jjkOmUtTsX3rsw7Mlo/Scarc2y tHm/SeK0fJub65nhIheOzHG52BRLJ8SenV/8EKPWmvwljhh9BpA3neAGM4/egz9WLc2U i3BNAUsTniJRVcBMEr6fYXlKoZjgQPzh6n0WwqtgX1sUaMkyFGAvzDoxlRXTCP2GSxbi BsVzjzE4851+pYxFXch6GLVvTL7dc77qyFY0juuGfZqN4h2ZwRDp1JYgd/Y8TNF6Yhcw GIvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dgFeyPkzmPObOkTR5EkP4yemPrUTiyxU/lmEG6g4BQs=; b=DQi0kkVxB3n17pU0OdYGHocqGDELtAt00Av3Bq7r6s5yH1+qAsn2YHpXKAqaVRm0Cg gX+swNIaPkZN2eAbrjOvuIIbCMXTebtfJRYsbRRs4zYKnB1NzpNFK/W5mEPjeMF8y2Ki mj854H3p+IXsfY7wsd0oQ2KCyaioF9Ym8mwRtFfYXtE4cUwyd/2Tb0jmjlUungjsF7qV FJFvDY7c4Vy7F994JvDE+qYD7ioHlD4NxPrNN1qu443PM90JMx8yWPi+rXKwoocsdhK1 YxVBtzj6qoIgcKm6Zejsz9ULpfvGiUXFh+Hj9DBKSFvIoNN+bRWWbQiaTaFJRTk6oGoY 78yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IZtsSrN8; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si13811310eje.519.2021.03.29.11.18.25; Mon, 29 Mar 2021 11:18:48 -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=@redhat.com header.s=mimecast20190719 header.b=IZtsSrN8; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230374AbhC2SRW (ORCPT + 99 others); Mon, 29 Mar 2021 14:17:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38107 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbhC2SRA (ORCPT ); Mon, 29 Mar 2021 14:17:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617041819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dgFeyPkzmPObOkTR5EkP4yemPrUTiyxU/lmEG6g4BQs=; b=IZtsSrN8cuyImG7I6iDIbOL52reW3UrS893LxEtv9uC69coMgUL0YsPK3x5htlbwF8Y0qU ekAAkTqY1lkFhhgOHImrYHP9d+AYkjxT899CGs6uGJjA5B3gG0ce9xc+hS75W/YgKpR0QY kSfo9YiPBlH45Wk52kHk4caovXelWOg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-303-igv5i0B5MrmOps8rHtPNUw-1; Mon, 29 Mar 2021 14:16:57 -0400 X-MC-Unique: igv5i0B5MrmOps8rHtPNUw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76EEC8030C4; Mon, 29 Mar 2021 18:16:55 +0000 (UTC) Received: from horse.redhat.com (ovpn-116-64.rdu2.redhat.com [10.10.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 508E539A60; Mon, 29 Mar 2021 18:16:52 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id DB50F220BCF; Mon, 29 Mar 2021 14:16:51 -0400 (EDT) Date: Mon, 29 Mar 2021 14:16:51 -0400 From: Vivek Goyal To: Luis Henriques Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtio-fs@redhat.com, miklos@szeredi.hu, dgilbert@redhat.com, seth.forshee@canonical.com Subject: Re: [PATCH v2 1/2] fuse: Add support for FUSE_SETXATTR_V2 Message-ID: <20210329181651.GD676525@redhat.com> References: <20210325151823.572089-1-vgoyal@redhat.com> <20210325151823.572089-2-vgoyal@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 29, 2021 at 03:50:37PM +0100, Luis Henriques wrote: > On Thu, Mar 25, 2021 at 11:18:22AM -0400, Vivek Goyal wrote: > > Fuse client needs to send additional information to file server when > > it calls SETXATTR(system.posix_acl_access). Right now there is no extra > > space in fuse_setxattr_in. So introduce a v2 of the structure which has > > more space in it and can be used to send extra flags. > > > > "struct fuse_setxattr_in_v2" is only used if file server opts-in for it using > > flag FUSE_SETXATTR_V2 during feature negotiations. > > > > Signed-off-by: Vivek Goyal > > --- > > fs/fuse/acl.c | 2 +- > > fs/fuse/fuse_i.h | 5 ++++- > > fs/fuse/inode.c | 4 +++- > > fs/fuse/xattr.c | 21 +++++++++++++++------ > > include/uapi/linux/fuse.h | 10 ++++++++++ > > 5 files changed, 33 insertions(+), 9 deletions(-) > > > > diff --git a/fs/fuse/acl.c b/fs/fuse/acl.c > > index e9c0f916349d..d31260a139d4 100644 > > --- a/fs/fuse/acl.c > > +++ b/fs/fuse/acl.c > > @@ -94,7 +94,7 @@ int fuse_set_acl(struct user_namespace *mnt_userns, struct inode *inode, > > return ret; > > } > > > > - ret = fuse_setxattr(inode, name, value, size, 0); > > + ret = fuse_setxattr(inode, name, value, size, 0, 0); > > kfree(value); > > } else { > > ret = fuse_removexattr(inode, name); > > diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h > > index 63d97a15ffde..d00bf0b9a38c 100644 > > --- a/fs/fuse/fuse_i.h > > +++ b/fs/fuse/fuse_i.h > > @@ -668,6 +668,9 @@ struct fuse_conn { > > /** Is setxattr not implemented by fs? */ > > unsigned no_setxattr:1; > > > > + /** Does file server support setxattr_v2 */ > > + unsigned setxattr_v2:1; > > + > > Minor (pedantic!) comment: most of the fields here start with 'no_*', so > maybe it's worth setting the logic to use 'no_setxattr_v2' instead? Hi Luis, "setxattr_v2" kind of makes more sense to me because it is disabled by default untile and unless client opts in. If I use no_setxattr_v2, then it means by default I will have to initialize it to 1. Right now, following automatically takes care of it. fc = kzalloc(sizeof(struct fuse_conn), GFP_KERNEL); Also, there are other examples which don't use "no_" prefix. auto_inval_data, explicit_inval_data, do_readdirplus, readdirplus_auto, async_dio..... and list goes on. Vivek