2024-01-05 00:00:31

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the nfsd tree with the nfsd-fixes tree

Hi all,

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

fs/nfsd/nfsctl.c

between commit:

76d296a82657 ("nfsd: drop the nfsd_put helper")

from the nfsd-fixes tree and commits:

3a0b966ab40f ("SUNRPC: discard sv_refcnt, and svc_get/svc_put")
9bf4b41b79a3 ("nfsd: rename nfsd_last_thread() to nfsd_destroy_serv()")

from the nfsd tree.

I fixed it up (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/nfsctl.c
index 87fed75808ff,cca1dd7b8c55..000000000000
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@@ -704,15 -707,12 +708,12 @@@ static ssize_t __write_ports_addfd(cha
if (err != 0)
return err;

- err = svc_addsock(nn->nfsd_serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);
+ serv = nn->nfsd_serv;
+ err = svc_addsock(serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);

- if (err < 0 && !serv->sv_nrthreads && !nn->keep_active)
- nfsd_last_thread(net);
- else if (err >= 0 && !serv->sv_nrthreads && !xchg(&nn->keep_active, 1))
- svc_get(serv);
- if (!nn->nfsd_serv->sv_nrthreads &&
- list_empty(&nn->nfsd_serv->sv_permsocks))
++ if (!serv->sv_nrthreads && list_empty(&serv->sv_permsocks))
+ nfsd_destroy_serv(net);

- svc_put(serv);
return err;
}

@@@ -750,22 -748,18 +751,17 @@@ static ssize_t __write_ports_addxprt(ch
if (err < 0 && err != -EAFNOSUPPORT)
goto out_close;

- if (!serv->sv_nrthreads && !xchg(&nn->keep_active, 1))
- svc_get(serv);
-
- svc_put(serv);
return 0;
out_close:
- xprt = svc_find_xprt(nn->nfsd_serv, transport, net, PF_INET, port);
+ xprt = svc_find_xprt(serv, transport, net, PF_INET, port);
if (xprt != NULL) {
svc_xprt_close(xprt);
svc_xprt_put(xprt);
}
out_err:
- if (!serv->sv_nrthreads && !nn->keep_active)
- nfsd_last_thread(net);
- if (!nn->nfsd_serv->sv_nrthreads &&
- list_empty(&nn->nfsd_serv->sv_permsocks))
++ if (!serv->sv_nrthreads && list_empty(&serv->sv_permsocks))
+ nfsd_destroy_serv(net);

- svc_put(serv);
return err;
}


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-01-05 03:51:59

by Chuck Lever III

[permalink] [raw]
Subject: Re: linux-next: manual merge of the nfsd tree with the nfsd-fixes tree

On Fri, Jan 05, 2024 at 11:00:07AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the nfsd tree got a conflict in:
>
> fs/nfsd/nfsctl.c
>
> between commit:
>
> 76d296a82657 ("nfsd: drop the nfsd_put helper")
>
> from the nfsd-fixes tree and commits:
>
> 3a0b966ab40f ("SUNRPC: discard sv_refcnt, and svc_get/svc_put")
> 9bf4b41b79a3 ("nfsd: rename nfsd_last_thread() to nfsd_destroy_serv()")
>
> from the nfsd tree.

Ugh.

I plan to rebase nfsd-next as soon as 76d296a82657 ("nfsd: drop the
nfsd_put helper") is merged. I'll have a closer look at this
conflict tomorrow (my time).


> I fixed it up (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/nfsctl.c
> index 87fed75808ff,cca1dd7b8c55..000000000000
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@@ -704,15 -707,12 +708,12 @@@ static ssize_t __write_ports_addfd(cha
> if (err != 0)
> return err;
>
> - err = svc_addsock(nn->nfsd_serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);
> + serv = nn->nfsd_serv;
> + err = svc_addsock(serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);
>
> - if (err < 0 && !serv->sv_nrthreads && !nn->keep_active)
> - nfsd_last_thread(net);
> - else if (err >= 0 && !serv->sv_nrthreads && !xchg(&nn->keep_active, 1))
> - svc_get(serv);
> - if (!nn->nfsd_serv->sv_nrthreads &&
> - list_empty(&nn->nfsd_serv->sv_permsocks))
> ++ if (!serv->sv_nrthreads && list_empty(&serv->sv_permsocks))
> + nfsd_destroy_serv(net);
>
> - svc_put(serv);
> return err;
> }
>
> @@@ -750,22 -748,18 +751,17 @@@ static ssize_t __write_ports_addxprt(ch
> if (err < 0 && err != -EAFNOSUPPORT)
> goto out_close;
>
> - if (!serv->sv_nrthreads && !xchg(&nn->keep_active, 1))
> - svc_get(serv);
> -
> - svc_put(serv);
> return 0;
> out_close:
> - xprt = svc_find_xprt(nn->nfsd_serv, transport, net, PF_INET, port);
> + xprt = svc_find_xprt(serv, transport, net, PF_INET, port);
> if (xprt != NULL) {
> svc_xprt_close(xprt);
> svc_xprt_put(xprt);
> }
> out_err:
> - if (!serv->sv_nrthreads && !nn->keep_active)
> - nfsd_last_thread(net);
> - if (!nn->nfsd_serv->sv_nrthreads &&
> - list_empty(&nn->nfsd_serv->sv_permsocks))
> ++ if (!serv->sv_nrthreads && list_empty(&serv->sv_permsocks))
> + nfsd_destroy_serv(net);
>
> - svc_put(serv);
> return err;
> }
>



--
Chuck Lever

2024-01-05 22:34:09

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: manual merge of the nfsd tree with the nfsd-fixes tree

Hi Chuck,

On Thu, 4 Jan 2024 22:51:07 -0500 Chuck Lever <[email protected]> wrote:
>
> I plan to rebase nfsd-next as soon as 76d296a82657 ("nfsd: drop the
> nfsd_put helper") is merged. I'll have a closer look at this
> conflict tomorrow (my time).

Instead of rebasing your tree just before the merge window, why not
just merge nfsd-fixes into the nfsd tree?

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-01-06 00:31:37

by Chuck Lever III

[permalink] [raw]
Subject: Re: linux-next: manual merge of the nfsd tree with the nfsd-fixes tree



> On Jan 5, 2024, at 5:33 PM, Stephen Rothwell <[email protected]> wrote:
>
> Hi Chuck,
>
> On Thu, 4 Jan 2024 22:51:07 -0500 Chuck Lever <[email protected]> wrote:
>>
>> I plan to rebase nfsd-next as soon as 76d296a82657 ("nfsd: drop the
>> nfsd_put helper") is merged. I'll have a closer look at this
>> conflict tomorrow (my time).
>
> Instead of rebasing your tree just before the merge window, why not
> just merge nfsd-fixes into the nfsd tree?

My development toolchain is stgit, where rebasing is butt-
simple.

I'm not smart enough to make all that work out, and merges
make my head hurt. That's why I let you and Linus handle it,
and then never rebase once my PRs are merged into
torvalds/linux.git.

I'm open to learning more, but I might resist making my dev
workflow more complicated.


--
Chuck Lever


2024-01-06 00:45:47

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: manual merge of the nfsd tree with the nfsd-fixes tree

Hi Chuck,

On Sat, 6 Jan 2024 00:26:53 +0000 Chuck Lever III <[email protected]> wrote:
>
> My development toolchain is stgit, where rebasing is butt-
> simple.
>
> I'm not smart enough to make all that work out, and merges
> make my head hurt. That's why I let you and Linus handle it,
> and then never rebase once my PRs are merged into
> torvalds/linux.git.
>
> I'm open to learning more, but I might resist making my dev
> workflow more complicated.

Understood, but if you are interested, see
Documentation/maintainer/rebasing-and-merging.rst

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature