lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100331150601.GC3322@quack.suse.cz>
Date:	Wed, 31 Mar 2010 17:06:02 +0200
From:	Jan Kara <jack@...e.cz>
To:	Dmitry Monakhov <dmonakhov@...nvz.org>
Cc:	linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	jack@...e.cz
Subject: Re: [PATCH 1/3] quota: optimize mark_dirty logic

  Hi,

On Sat 27-03-10 15:15:38, Dmitry Monakhov wrote:
> - Skipp locking if quota is dirty already.
> - Return old quota state to help fs-specciffic implementation to optimize
>   case where quota was dirty already.
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>
> ---
>  fs/quota/dquot.c |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index e0b870f..88a8ef2 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -319,14 +319,23 @@ static inline int mark_dquot_dirty(struct dquot *dquot)
>  	return dquot->dq_sb->dq_op->mark_dirty(dquot);
>  }
>  
> +/* Mark dquot dirty in atomic meaner, and return it's old dirty flag state */
>  int dquot_mark_dquot_dirty(struct dquot *dquot)
>  {
> +	int ret = 1;
> +
> +	/* If quota is dirtly already we don't have to acquire dq_list_lock */
> +	if (test_bit(DQ_MOD_B, &dquot->dq_flags))
> +		return 1;
> +
>  	spin_lock(&dq_list_lock);
> -	if (!test_and_set_bit(DQ_MOD_B, &dquot->dq_flags))
> +	if (!test_and_set_bit(DQ_MOD_B, &dquot->dq_flags)) {
>  		list_add(&dquot->dq_dirty, &sb_dqopt(dquot->dq_sb)->
>  				info[dquot->dq_type].dqi_dirty_list);
> +		ret = 0;
> +	}
>  	spin_unlock(&dq_list_lock);
> -	return 0;
> +	return ret;
>  }
>  EXPORT_SYMBOL(dquot_mark_dquot_dirty);
  OK, this looks fine. Merged.

								Honza
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ