tech-kern archive

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

Re: Finding an available fss device




> On 10. Aug 2018, at 15:46, Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
> 
> Hello
> 
> How are user processes supposed to find an unused fss device?
> In dump(8) code,  there is an iteration on /dev/rfss* trying to
> performan an ioctl FSSIOCSET. The code tests for EBUSY on failure,
> but in my experience that struggles to happen: if the device is 
> already in use, the ioctl will sleep in the kernel for ages before 
> getting a reply.
> 
> This is something I can even experience with fssconfig -l, which 
> hangs for a while if dump is running.
> 
> Is there another way? I thought about searching vnode in kernel to 
> check if the device is already used by someone else, but that looks 
> overkill. 
> 
> Perhaps the right way is to add a FSSIOBUSY ioctl that would
> use mutex_tryenter and return EBUSY if the device is in use?

When fssconfig "hangs" the dump is creating a snapshot.  Creating
a snapshot (and suspending a file system) is serialized.  Allowing
more than one file system suspension at a time will deadlock most
of the time.

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)



Home | Main Index | Thread Index | Old Index