[PATCH v2] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Maxim Patlasov
ms in straightforward way: refuse queuing too many works in btrfs_wq_run_delayed_node and bail out of worker func if at least BTRFS_DELAYED_WRITEBACK items are processed. Changed in v2: remove support of thresh == NO_THRESHOLD. Signed-off-by: Maxim Patlasov --- fs/btrfs/async-thread.c | 14 ++

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Maxim Patlasov
On 12/12/2016 06:54 AM, David Sterba wrote: On Fri, Dec 02, 2016 at 05:51:36PM -0800, Maxim Patlasov wrote: Problem statement: unprivileged user who has read-write access to more than one btrfs subvolume may easily consume all kernel memory (eventually triggering oom-killer). Reproducer

[PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-03 Thread Maxim Patlasov
ms in straightforward way: refuse queuing too many works in btrfs_wq_run_delayed_node and bail out of worker func if at least BTRFS_DELAYED_WRITEBACK items are processed. Signed-off-by: Maxim Patlasov --- fs/btrfs/async-thread.c |8 fs/btrfs/async-thread.h |1 + fs/btrfs/delay