lkml.org 
[lkml]   [2010]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] quota: fix reserved space management for ordinary fs
Date

In fact inode_get_rsv_space() function is special in comparison
with inode_{add,sub,claim}_rsv_space() functions, because
it may return correct result even for fs without reserved space
support(correct val == 0). Add trivial check for that case.
The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/quota/dquot.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index dea86ab..d9f06cf 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1377,6 +1377,8 @@ static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
static qsize_t inode_get_rsv_space(struct inode *inode)
{
qsize_t ret;
+ if (!inode->i_sb->dq_op->get_reserved_space)
+ return 0;
spin_lock(&inode->i_lock);
ret = *inode_reserved_space(inode);
spin_unlock(&inode->i_lock);
--
1.6.3.3




\
 
 \ /
  Last update: 2010-01-08 01:57    [W:2.072 / U:1.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site