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

Re: [PATCH] More debugging info when failing to open multiple files



Hi Vladimir,

Can you please send that as a unified diff?

"diff -u" produces that (or "git diff"). This makes it easier to review the patch.

Thanks,

On Sun, Jan 05, 2020 at 02:36:24PM +0100, Vladimir Jelezarov wrote:
> Hi all,
> 
> 
> When nbd-server with the "multifile = true" option is fed with more files than
> the current system's limit, it silently opens files up to the limit and then
> proceeds with no error message thrown, even in debugging mode "-d". As a
> result, not the entire expected file size shows in /dev/nbdX, which can be
> confusing.
> 
> I propose adding at least an "err_nonfatal" warning when in debug mode.
> 
> 
> 1885,1886c1885,1888
> <                 if(multifile && i>0)
> <                     break;
> ---
> >                 if(multifile && i>0) {
>                      err_nonfatal(strerror(errno));
>                      break;
> >                 }
> 
> 
> 
> Greetings
> 
> Vladimir
> 
> 
> 
> 
> 
> -------- Forwarded Message --------
> Subject: Is there a limit on the count of the exported devices?
>    Date: Sat, 4 Jan 2020 21:20:40 +0100
>    From: Vladimir Zhelezarov <jelezarov.vladimir@gmail.com>
>      To: nbd@other.debian.org
> 
> 
> 
> Hi,
> 
> independent of the size of the combined block device, I am unable to use more
> than 1018 devices with the "-m" option in nbd-server. So for example:
> 
> 
>     for i in {0..1999}; do truncate -s 1M mm.$i; done
>     sudo nbd-server -C /dev/null localhost@33333 -m /home/user/nbd/mm
>     sudo nbd-client localhost 33333 /dev/nbd0
> 
> 
> Then it says:
> 
>     Negotiation: ..size = 1018MB
>     bs=1024, sz=1067450368 bytes
> 
> which can also be confirmed by mounting /dev/nbd0.
> 
> 
> Another example with 5000 files of 500K gives:
> 
>     Negotiation: ..size = 497MB
>     bs=1024, sz=521216000 bytes
> 
> which gives the same 521216000/1024/500 = 1018 used files.
> 
> 
> The same happens when using different sizes or combinations of sizes and
> file-counts. I am using nbd 3.20 on x64 Ubuntu 18.04. Using a configuration
> file makes no difference. Different hardware with the same OS and nbd version
> neither.
> 
> 
> Can someone give me some pointers?
> 
> 
> Vladimir
> 

> 1885,1886c1885,1888
> < 				if(multifile && i>0)
> < 					break;
> ---
> > 				if(multifile && i>0) {
>  					err_nonfatal(strerror(errno));
>  					break;
> > 				}


-- 
To the thief who stole my anti-depressants: I hope you're happy

  -- seen somewhere on the Internet on a photo of a billboard


Reply to: