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

Re: [Nbd] Using nbd on Android



On Mon, Sep 22, 2014 at 07:27:20AM -0400, Brandon Amos wrote:
> Hi Wouter,
> 
> > I see you needed to disable use of mlockall() for that. Care to send a
> > patch? This should preferably check for existence of mlockall() in
> > configure, and #ifdef it away if it's not present.
> Sure, I'm happy to send in a patch for this.
> Do you want me to add checks so that the `-swap` option is disabled
> completely in Android, or just to disable the `mlockall` call and throw a
> warning when starting with the swap option on Android?

It's probably best to error out if mlockall() doesn't exist. The reason
for that call is to ensure nbd-client doesn't get swapped out to its own
block device; if one tries to swap to nbd without the client being
memory-locked, this will very likely result in deadlocks.

> The Tor bug tracker has a useful post on this:
> https://trac.torproject.org/projects/tor/ticket/1147

Right.

> > I also noticed you used qemu-nbd rather than nbd-server. Any particular
> > reason for that?
> I'm using nbd with a larger project that uses a custom version of qemu-nbd
> to intercept block device writes. I'm not sure why qemu-nbd was
> chosen in place of nbd-server.

Fair enough.

-- 
It is easy to love a country that is famous for chocolate and beer

  -- Barack Obama, speaking in Brussels, Belgium, 2014-03-26



Reply to: