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

Re: [Nbd] Proposal to merge WRITE_ZEROES extension into master



On Mon, Dec 19, 2016 at 03:54:04PM -0600, Eric Blake wrote:
> On 12/19/2016 03:41 PM, Wouter Verhelst wrote:
> > On Thu, Dec 15, 2016 at 12:09:42PM +0100, Wouter Verhelst wrote:
> >> Eric's patch makes -d work again, but disables maxconnections in that
> >> case. I'll need to fix it up; hopefully that'll happen sometime next
> >> week, because otherwise I'll be too late to make the Debian freeze for
> >> stretch, and I'd really like STARTTLS to be in there.
> > 
> > I'm an idiot :-)
> > 
> > When we say "don't fork", that means we cannot handle more than one
> > connection, because we can't fork, and we do fork-per-child.
> > 
> > I'll apply Eric's patch, it's the correct thing to do.
> 
> I'm not sure if I broke the ACL handling in my patch, though, so you'll
> want to double-check that aspect of it (I basically hardcoded -d to mean
> that the ACL check would always succeed).

Like I said, that's the right thing to do :-)

I had some trouble picking a good variable name when I called that
"acl". It isn't really an acl, but it looks like it a bit. It's only
used for maxconnections, and I don't think it'll be used for something
else in the near future (if that does ever change, we'll have to fix
this then, but that's a problem for that moment).

This, however, is *not* the right thing to do:

diff --git a/nbd-server.c b/nbd-server.c
index cbe7e57..45cb591 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -2025,7 +2025,7 @@ static void handle_write_zeroes(CLIENT* client, struct nbd_request* req) {
        // TODO: handle this far more efficiently with reference to the
        // actual backing driver
        pthread_mutex_lock(&(client->lock));
-       writeit(client->net, &rep, sizeof rep);
+       socket_write(client, &rep, sizeof rep);
        pthread_mutex_unlock(&(client->lock));
 }

I'm going to have to do a 3.15.1 for that, otherwise WRITE_ZEROES
handling will be broken with TLS enabled.

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12



Reply to: