public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] quota: paranoia: check quota tree root
Date: Thu, 12 Feb 2015 15:04:06 +0100	[thread overview]
Message-ID: <20150212140406.GB12905@quack.suse.cz> (raw)
In-Reply-To: <20150212093649.6117.62111.stgit@buzz>

On Thu 12-02-15 12:36:49, Konstantin Khlebnikov wrote:
> Root level in quota tree must be already allocated otherwise this block
> could be used for something else.
  Thanks. I've added the patch to my tree.

							Honza

> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> ---
>  fs/quota/quota_tree.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
> index d65877f..58efb83 100644
> --- a/fs/quota/quota_tree.c
> +++ b/fs/quota/quota_tree.c
> @@ -349,6 +349,13 @@ static inline int dq_insert_tree(struct qtree_mem_dqinfo *info,
>  				 struct dquot *dquot)
>  {
>  	int tmp = QT_TREEOFF;
> +
> +#ifdef __QUOTA_QT_PARANOIA
> +	if (info->dqi_blocks <= QT_TREEOFF) {
> +		quota_error(dquot->dq_sb, "Quota tree root isn't allocated!");
> +		return -EIO;
> +	}
> +#endif
>  	return do_insert_tree(info, dquot, &tmp, 0);
>  }
>  
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2015-02-12 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  9:36 [PATCH] quota: paranoia: check quota tree root Konstantin Khlebnikov
2015-02-12 14:04 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150212140406.GB12905@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox