Re: [PATCH] kernfs: use stack-buf for small writes.

Tejun Heo
2014-09-23T04:13:04Z

Hello, Neil.

On Tue, Sep 23, 2014 at 02:06:33PM +1000, NeilBrown wrote:
> When mdmon needs to update metadata after a device failure in an array
> there are two 'kmalloc' sources that can trigger deadlock if memory is tight
> and needs to be written to the array (which cannot be allowed until mdmon
> updates the metadata).
> One is in O_DIRECT writes which I have patches for. The other is when
> writing to the sysfs file to tell md that it is safe to continue.
> This simple patch removes the second.

Ugh... :( If this can't be avoided at all, I'd much prefer it to be
something explicit - a flag marking the file as needing a persistent
write buffer which is allocated on open. "Small" writes on stack
feels way to implicit to me.

Thanks.

--
tejun