Re: [GIT PULL] vfs netfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Sept 2024 at 18:57, Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> /* Conflicts */
>
> Merge conflicts with mainline

Hmm.

My conflict resolution is _similar_, but at the same time decidedly
different. And I'm not sure why yours is different.

> --- a/fs/smb/client/cifssmb.c
> +++ b/fs/smb/client/cifssmb.c
> @@@ -1261,16 -1261,6 +1261,14 @@@ openRetry
>         return rc;
>   }
>
>  +static void cifs_readv_worker(struct work_struct *work)
>  +{
>  +      struct cifs_io_subrequest *rdata =
>  +              container_of(work, struct cifs_io_subrequest, subreq.work);
>  +
> -       netfs_subreq_terminated(&rdata->subreq,
> -                               (rdata->result == 0 || rdata->result == -EAGAIN) ?
> -                               rdata->got_bytes : rdata->result, true);
> ++      netfs_read_subreq_terminated(&rdata->subreq, rdata->result, false);

So here, I have

++      netfs_read_subreq_terminated(&rdata->subreq, rdata->result, true);

with the third argument being 'true' instead of 'false' as in yours.

The reason? That's what commit a68c74865f51 ("cifs: Fix SMB1
readv/writev callback in the same way as SMB2/3") did when it moved
the (originally) netfs_subreq_terminated() into the worker, and it
changed the 'was_async' argument from "false" to a "true".

Now, that change makes little sense to me (a worker thread is not
softirq context), but  that's what commit a68c74865f51 does, and so
that's logically what the merge should do.

> +       rdata->subreq.transferred += rdata->got_bytes;
>  -      netfs_read_subreq_terminated(&rdata->subreq, rdata->result, false);
> ++      trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_progress);

where did this trace_netfs_sreq() come from?

> --- a/fs/smb/client/smb2pdu.c
> +++ b/fs/smb/client/smb2pdu.c
> @@@ -4614,6 -4613,10 +4613,8 @@@ smb2_readv_callback(struct mid_q_entry
>                               server->credits, server->in_flight,
>                               0, cifs_trace_rw_credits_read_response_clear);
>         rdata->credits.value = 0;
> +       rdata->subreq.transferred += rdata->got_bytes;
>  -      if (rdata->subreq.start + rdata->subreq.transferred >= rdata->subreq.rreq->i_size)
>  -              __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);
> +       trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_progress);

And where did this conflict resolution come from? I'm not seeing why
it removes that NETFS_SREQ_HIT_EOF bit logic..

Some searching gets me this:

    https://lore.kernel.org/all/1131388.1726141806@xxxxxxxxxxxxxxxxxxxxxx/

which seems to explain your merge resolution, and I'm even inclined to
think that it might be right, but it's not *sensible*.

That whole removal of the NETFS_SREQ_HIT_EOF bit ends up undoing part
of commit ee4cdf7ba857 ("netfs: Speed up buffered reading"), and
doesn't seem to be supported by the changes done on the other side of
the conflict resolution.

IOW, the changes may be *correct*, but they do not seem to be valid as
a conflict resolution, and if they are fixes they should be done as
such separately.

Adding DavidH (and Steve French) to the participants, so that they can
know about my confusion, and maybe send a patch to fix it up properly
with actual explanations. Because I don't want to commit the merge as
you suggest without explanations for why those changes were magically
done independently of what seems to be happening in the development
history.

                 Linus




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux