linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the nfsd tree with the cel-fixes tree
@ 2022-09-13  0:25 Stephen Rothwell
  2022-09-13  1:47 ` Chuck Lever III
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2022-09-13  0:25 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Linux Kernel Mailing List, Linux Next Mailing List, NeilBrown

[-- Attachment #1: Type: text/plain, Size: 2622 bytes --]

Hi all,

Today's linux-next merge of the nfsd tree got a conflict in:

  fs/nfsd/vfs.c

between commit:

  00801cd92d91 ("NFSD: fix regression with setting ACLs.")

from the cel-fixes tree and commit:

  e9de96c3df55 ("NFSD: Refactor nfsd_setattr()")

from the nfsd tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/nfsd/vfs.c
index 19f28c33e44d,8eda499de545..000000000000
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@@ -343,6 -339,44 +343,48 @@@ nfsd_get_write_access(struct svc_rqst *
  	return nfserrno(get_write_access(inode));
  }
  
+ static int __nfsd_setattr(struct dentry *dentry, struct iattr *iap)
+ {
+ 	int host_err;
+ 
+ 	if (iap->ia_valid & ATTR_SIZE) {
+ 		/*
+ 		 * RFC5661, Section 18.30.4:
+ 		 *   Changing the size of a file with SETATTR indirectly
+ 		 *   changes the time_modify and change attributes.
+ 		 *
+ 		 * (and similar for the older RFCs)
+ 		 */
+ 		struct iattr size_attr = {
+ 			.ia_valid	= ATTR_SIZE | ATTR_CTIME | ATTR_MTIME,
+ 			.ia_size	= iap->ia_size,
+ 		};
+ 
+ 		if (iap->ia_size < 0)
+ 			return -EFBIG;
+ 
+ 		host_err = notify_change(&init_user_ns, dentry, &size_attr, NULL);
+ 		if (host_err)
+ 			return host_err;
+ 		iap->ia_valid &= ~ATTR_SIZE;
+ 
+ 		/*
+ 		 * Avoid the additional setattr call below if the only other
+ 		 * attribute that the client sends is the mtime, as we update
+ 		 * it as part of the size change above.
+ 		 */
+ 		if ((iap->ia_valid & ~ATTR_MTIME) == 0)
+ 			return 0;
+ 	}
+ 
 -	iap->ia_valid |= ATTR_CTIME;
 -	return notify_change(&init_user_ns, dentry, iap, NULL);
++	if (iap->ia_valid) {
++		iap->ia_valid |= ATTR_CTIME;
++		return notify_change(&init_user_ns, dentry, iap, NULL);
++	}
++
++	return 0;
+ }
+ 
  /*
   * Set various file attributes.  After this call fhp needs an fh_put.
   */
@@@ -357,9 -391,10 +399,10 @@@ nfsd_setattr(struct svc_rqst *rqstp, st
  	int		accmode = NFSD_MAY_SATTR;
  	umode_t		ftype = 0;
  	__be32		err;
 -	int		host_err;
 +	int		host_err = 0;
  	bool		get_write_count;
  	bool		size_change = (iap->ia_valid & ATTR_SIZE);
+ 	int		retries;
  
  	if (iap->ia_valid & ATTR_SIZE) {
  		accmode |= NFSD_MAY_WRITE|NFSD_MAY_OWNER_OVERRIDE;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the nfsd tree with the cel-fixes tree
  2022-09-13  0:25 linux-next: manual merge of the nfsd tree with the cel-fixes tree Stephen Rothwell
@ 2022-09-13  1:47 ` Chuck Lever III
  2022-09-13  2:27   ` Stephen Rothwell
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever III @ 2022-09-13  1:47 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Neil Brown

Hi Stephen-

> On Sep 12, 2022, at 5:25 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Hi all,
> 
> Today's linux-next merge of the nfsd tree got a conflict in:
> 
>  fs/nfsd/vfs.c
> 
> between commit:
> 
>  00801cd92d91 ("NFSD: fix regression with setting ACLs.")
> 
> from the cel-fixes tree and commit:
> 
>  e9de96c3df55 ("NFSD: Refactor nfsd_setattr()")
> 
> from the nfsd tree.
> 
> I fixed it up (I think - see below) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.

Apologies, I didn't realize this state of affairs would create a
merge conflict in linux-next.

nfsd's for-next is currently based on v6.0-rc5, which does not have
00801cd92d91 ("NFSD: fix regression with setting ACLs.") yet. Next
week I will rebase nfsd's for-next on v6.0-rc6, which should resolve
this conflict. I will test the conflict resolution with the usual suite
of NFSD check-in tests before pushing that update to for-next.


> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc fs/nfsd/vfs.c
> index 19f28c33e44d,8eda499de545..000000000000
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@@ -343,6 -339,44 +343,48 @@@ nfsd_get_write_access(struct svc_rqst *
>  	return nfserrno(get_write_access(inode));
>  }
> 
> + static int __nfsd_setattr(struct dentry *dentry, struct iattr *iap)
> + {
> + 	int host_err;
> + 
> + 	if (iap->ia_valid & ATTR_SIZE) {
> + 		/*
> + 		 * RFC5661, Section 18.30.4:
> + 		 *   Changing the size of a file with SETATTR indirectly
> + 		 *   changes the time_modify and change attributes.
> + 		 *
> + 		 * (and similar for the older RFCs)
> + 		 */
> + 		struct iattr size_attr = {
> + 			.ia_valid	= ATTR_SIZE | ATTR_CTIME | ATTR_MTIME,
> + 			.ia_size	= iap->ia_size,
> + 		};
> + 
> + 		if (iap->ia_size < 0)
> + 			return -EFBIG;
> + 
> + 		host_err = notify_change(&init_user_ns, dentry, &size_attr, NULL);
> + 		if (host_err)
> + 			return host_err;
> + 		iap->ia_valid &= ~ATTR_SIZE;
> + 
> + 		/*
> + 		 * Avoid the additional setattr call below if the only other
> + 		 * attribute that the client sends is the mtime, as we update
> + 		 * it as part of the size change above.
> + 		 */
> + 		if ((iap->ia_valid & ~ATTR_MTIME) == 0)
> + 			return 0;
> + 	}
> + 
> -	iap->ia_valid |= ATTR_CTIME;
> -	return notify_change(&init_user_ns, dentry, iap, NULL);
> ++	if (iap->ia_valid) {
> ++		iap->ia_valid |= ATTR_CTIME;
> ++		return notify_change(&init_user_ns, dentry, iap, NULL);
> ++	}
> ++
> ++	return 0;
> + }
> + 
>  /*
>   * Set various file attributes.  After this call fhp needs an fh_put.
>   */
> @@@ -357,9 -391,10 +399,10 @@@ nfsd_setattr(struct svc_rqst *rqstp, st
>  	int		accmode = NFSD_MAY_SATTR;
>  	umode_t		ftype = 0;
>  	__be32		err;
> -	int		host_err;
> +	int		host_err = 0;
>  	bool		get_write_count;
>  	bool		size_change = (iap->ia_valid & ATTR_SIZE);
> + 	int		retries;
> 
>  	if (iap->ia_valid & ATTR_SIZE) {
>  		accmode |= NFSD_MAY_WRITE|NFSD_MAY_OWNER_OVERRIDE;

--
Chuck Lever




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the nfsd tree with the cel-fixes tree
  2022-09-13  1:47 ` Chuck Lever III
@ 2022-09-13  2:27   ` Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2022-09-13  2:27 UTC (permalink / raw)
  To: Chuck Lever III
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Neil Brown

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

Hi Chuck,

On Tue, 13 Sep 2022 01:47:01 +0000 Chuck Lever III <chuck.lever@oracle.com> wrote:
>
> nfsd's for-next is currently based on v6.0-rc5, which does not have
> 00801cd92d91 ("NFSD: fix regression with setting ACLs.") yet. Next
> week I will rebase nfsd's for-next on v6.0-rc6, which should resolve
> this conflict. I will test the conflict resolution with the usual suite
> of NFSD check-in tests before pushing that update to for-next.

Why not just merge the cel-fixes tree into the nfsd tree (with this
fixup in the merge) and not pick up all the rest of -rc6.  Also will
save a rebase ;-)

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-13  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13  0:25 linux-next: manual merge of the nfsd tree with the cel-fixes tree Stephen Rothwell
2022-09-13  1:47 ` Chuck Lever III
2022-09-13  2:27   ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).