We already has per-dquot sanity checks, but with per-inode checks quota leakage investigation becomes much easier. Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx> --- fs/quota/dquot.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e0b870f..4db57b7 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1428,6 +1428,8 @@ EXPORT_SYMBOL(inode_add_rsv_space); void inode_claim_rsv_space(struct inode *inode, qsize_t number) { spin_lock(&inode->i_lock); + if (*inode_reserved_space(inode) < number) + WARN_ON_ONCE(1); *inode_reserved_space(inode) -= number; __inode_add_bytes(inode, number); spin_unlock(&inode->i_lock); @@ -1437,6 +1439,8 @@ EXPORT_SYMBOL(inode_claim_rsv_space); void inode_sub_rsv_space(struct inode *inode, qsize_t number) { spin_lock(&inode->i_lock); + if (*inode_reserved_space(inode) < number) + WARN_ON_ONCE(1); *inode_reserved_space(inode) -= number; spin_unlock(&inode->i_lock); } -- 1.6.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html