Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754523Ab0AHAyE (ORCPT ); Thu, 7 Jan 2010 19:54:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754506Ab0AHAyB (ORCPT ); Thu, 7 Jan 2010 19:54:01 -0500 Received: from mail-fx0-f225.google.com ([209.85.220.225]:60918 "EHLO mail-fx0-f225.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754498Ab0AHAyB (ORCPT ); Thu, 7 Jan 2010 19:54:01 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=FGFsOMnazunY2+cHqjV0hgS6RQHeUwmJ7I9zz4U6Yqdm7eTqQIznr6G51l9MR/if03 +UOuzwbtM/4zw9QABdVw18UvObu5EbU3ryorR/yRPgaaFmYnqftZff9hWdB/bL8ATyWj yumGHfY1eEZHRlnWqwPFy6crpG8RDxLOgjIRo= From: Dmitry Monakhov To: Dmitry Monakhov Cc: Greg KH , Thomas Voegtle , Jan Kara , "Theodore Ts'o" , linux-kernel@vger.kernel.org, Andrew Morton , torvalds@linux-foundation.org, stable@kernel.org Subject: [PATCH] quota: fix reserved space management for ordinary fs References: <20100106234533.GC1960@kroah.com> <20100107180449.GA17495@suse.de> <20100107194131.GA22983@suse.de> <20100107220213.GA24882@suse.de> Date: Fri, 08 Jan 2010 03:53:54 +0300 In-Reply-To: (Dmitry Monakhov's message of "Fri, 8 Jan 2010 03:03:30 +0300") Message-ID: <87wrztpgbh.fsf_-_@openvz.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1222 Lines: 36 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/