Re: [RFC PATCH] tmpfs: support user quotas

From: Lennart Poettering
Date: Sun Nov 06 2011 - 17:10:38 EST


On Sun, 06.11.11 18:15, Davidlohr Bueso (dave@xxxxxxx) wrote:

> From: Davidlohr Bueso <dave@xxxxxxx>
>
> This patch adds a new RLIMIT_TMPFSQUOTA resource limit to restrict an individual user's quota across all mounted tmpfs filesystems.
> It's well known that a user can easily fill up commonly used directories (like /tmp, /dev/shm) causing programs to break through DoS.

Thanks a lot for this work! One comment without looking at the patch in detail:

> + if (atomic_long_read(&user->shmem_bytes) + len >
> + rlimit(RLIMIT_TMPFSQUOTA))
> + return -ENOSPC;

This should be EDQUOT "Disk quota exceeded", not ENOSPC "No space left
on device".

Lennart

--
Lennart Poettering - Red Hat, Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/