Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3085428pxb; Mon, 18 Oct 2021 07:59:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX/5ZmuDS3wHDWeCJpaTORQ04hA5vNqLc85Xj4J1OtK5lIg/jh6G5FkZsSd0f0jH6cKZPr X-Received: by 2002:a17:902:c401:b0:13e:f5f2:f852 with SMTP id k1-20020a170902c40100b0013ef5f2f852mr27875069plk.29.1634569161062; Mon, 18 Oct 2021 07:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634569161; cv=none; d=google.com; s=arc-20160816; b=wbyuY3AeXE4bbDYmhulS6RWnHWtpsjNAH0cTL6QRHoXKKwp85WKH0034MrTAIFbeip lZ4tmPfvEYesZIgyno/zpjCZZB41vKIh++mKUDtso/lysI3btyWDE2rCRaAk/CZPYqhP 2PDjT0oIILTKN6+0YULRjllPSPHWI3YEyIF2GDKNjuYI/vHGv9oxlU564iUKP7d0XTA3 f2pN6cE3JFQfLL8ZYGFZygjev8hMDm3QANDDb0F2S2yfB3yc0Ld748nlf5/HBqSHQ029 Y5MJ0Qfa80OCzHeNcv0IdsmScaUZyrY5jZkJdVPt+lGdr4HXN9S+q3GJ9VnE1BOPikEI h62g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:dkim-signature; bh=qpmC6KV6XlN7tGrzNmQxvfZVaWj4hw0BElRSYjH98xU=; b=YWyBd8giZ6Hh+Fts3rPN26+vnybxbonKvNQmgOGINmNK4VYkwO4zlFMTx2rcJQ+7np yI34CQXW0h5soJItqTUe0ESg2Ao2zld1kZ0kHZBZkHFw/KOA8BaPJCeV0aBhhL1I9KmC xpOsSi73eR0H815sBvWSq6Na7psn9+rPKe/fnqXuHTyGu89y98EGcL2SqCudX2e+s7O4 /SyTUCdtnCrmkmmCjVAe6ARyUY0JyOoq3GcsxuUw+/gUNnbhiKzYEOEFlK5p+JGhiQFj sjDBduieVVCBdABX5g6zGtKNXSZTKnUOCOxtV5+TstRCHEEanKxblVMwNRHUZfqoRqrn 2B2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fTLKzGAT; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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 a13si1652921pjd.90.2021.10.18.07.59.08; Mon, 18 Oct 2021 07:59:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=fTLKzGAT; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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 S233129AbhJRPBQ (ORCPT + 99 others); Mon, 18 Oct 2021 11:01:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39221 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbhJRPBP (ORCPT ); Mon, 18 Oct 2021 11:01:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634569143; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qpmC6KV6XlN7tGrzNmQxvfZVaWj4hw0BElRSYjH98xU=; b=fTLKzGAT4CDB0pcGljBFPZrxTSL1ayNf9dbRPEcjTE43E2yjyK8TlEVwWPahtbjHte/ULT BHPgGdZ87BotgUB+3N+XO/UX5zaa4XjoUBk1CHwjexuBjnQpP0EFQSCgtTVyDRZywzNKf0 jbDU5V0I+qUc+RkI0H9dz8QaDWAXbaE= 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-512-ncCaC32SNx61rESZ2ISbmQ-1; Mon, 18 Oct 2021 10:59:00 -0400 X-MC-Unique: ncCaC32SNx61rESZ2ISbmQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3CD1B802682; Mon, 18 Oct 2021 14:58:58 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84A8B5F4EE; Mon, 18 Oct 2021 14:58:52 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 31/67] cachefiles: Don't use XATTR_ flags with vfs_setxattr() From: David Howells To: linux-cachefs@redhat.com Cc: dhowells@redhat.com, Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Jeff Layton , Matthew Wilcox , Alexander Viro , Omar Sandoval , Linus Torvalds , linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 18 Oct 2021 15:58:51 +0100 Message-ID: <163456913173.2614702.12279776553978969628.stgit@warthog.procyon.org.uk> In-Reply-To: <163456861570.2614702.14754548462706508617.stgit@warthog.procyon.org.uk> References: <163456861570.2614702.14754548462706508617.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Don't pass XATTR_CREATE/XATTR_REPLACE to vfs_setxattr(); just pass 0 as we don't want to have to deal with the error or try to guess which we want to use. Signed-off-by: David Howells --- fs/cachefiles/interface.c | 2 +- fs/cachefiles/internal.h | 3 +-- fs/cachefiles/namei.c | 2 +- fs/cachefiles/xattr.c | 6 ++---- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c index 3e678ab14c85..674d3d75fa70 100644 --- a/fs/cachefiles/interface.c +++ b/fs/cachefiles/interface.c @@ -132,7 +132,7 @@ static void cachefiles_update_object(struct cachefiles_object *object) cache = container_of(object->cache, struct cachefiles_cache, cache); cachefiles_begin_secure(cache, &saved_cred); - cachefiles_set_object_xattr(object, XATTR_REPLACE); + cachefiles_set_object_xattr(object); cachefiles_end_secure(cache, saved_cred); _leave(""); } diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h index ff00c5249f4f..92f90a5a4e93 100644 --- a/fs/cachefiles/internal.h +++ b/fs/cachefiles/internal.h @@ -162,8 +162,7 @@ static inline void cachefiles_end_secure(struct cachefiles_cache *cache, /* * xattr.c */ -extern int cachefiles_set_object_xattr(struct cachefiles_object *object, - unsigned int xattr_flags); +extern int cachefiles_set_object_xattr(struct cachefiles_object *object); extern int cachefiles_check_auxdata(struct cachefiles_object *object); extern int cachefiles_remove_object_xattr(struct cachefiles_cache *cache, struct dentry *dentry); diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index a60ef6f1cf1e..cb08be5fb28e 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -291,7 +291,7 @@ static int cachefiles_check_open_object(struct cachefiles_cache *cache, if (object->new) { /* attach data to a newly constructed terminal object */ - ret = cachefiles_set_object_xattr(object, XATTR_CREATE); + ret = cachefiles_set_object_xattr(object); if (ret < 0) goto error_unmark; } else { diff --git a/fs/cachefiles/xattr.c b/fs/cachefiles/xattr.c index bfb2f4d605af..82c822bb71af 100644 --- a/fs/cachefiles/xattr.c +++ b/fs/cachefiles/xattr.c @@ -26,8 +26,7 @@ static const char cachefiles_xattr_cache[] = /* * set the state xattr on a cache file */ -int cachefiles_set_object_xattr(struct cachefiles_object *object, - unsigned int xattr_flags) +int cachefiles_set_object_xattr(struct cachefiles_object *object) { struct cachefiles_xattr *buf; struct dentry *dentry; @@ -51,8 +50,7 @@ int cachefiles_set_object_xattr(struct cachefiles_object *object, clear_bit(FSCACHE_COOKIE_AUX_UPDATED, &object->cookie->flags); ret = vfs_setxattr(&init_user_ns, dentry, cachefiles_xattr_cache, - buf, sizeof(struct cachefiles_xattr) + len, - xattr_flags); + buf, sizeof(struct cachefiles_xattr) + len, 0); if (ret < 0) { trace_cachefiles_coherency(object, file_inode(file)->i_ino, 0,