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: <20190429214956.GA6740@quack2.suse.cz>
Date:   Mon, 29 Apr 2019 23:49:56 +0200
From:   Jan Kara <jack@...e.cz>
To:     Chengguang Xu <cgxu519@....com>
Cc:     jack@...e.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] quota: set init_needed flag only when successfully
 getting dquot

On Sun 28-04-19 13:39:21, Chengguang Xu wrote:
> Set init_needed flag only when successfully getting dquot,
> so that we can skip unnecessary subsequent operation.
> 
> Signed-off-by: Chengguang Xu <cgxu519@....com>

Thanks for the patch but I don't think it's really useful. It will be very
rare that we race with quotaoff of dqget() fails due to error. So the
additional overhead of iterating over dquots doesn't really matter in that
case.

								Honza

> ---
>  fs/quota/dquot.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index fc20e06c56ba..8d4ce2a2b5c8 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -1449,8 +1449,6 @@ static int __dquot_initialize(struct inode *inode, int type)
>  		if (!sb_has_quota_active(sb, cnt))
>  			continue;
> 
> -		init_needed = 1;
> -
>  		switch (cnt) {
>  		case USRQUOTA:
>  			qid = make_kqid_uid(inode->i_uid);
> @@ -1475,6 +1473,9 @@ static int __dquot_initialize(struct inode *inode, int type)
>  			dquot = NULL;
>  		}
>  		got[cnt] = dquot;
> +
> +		if (got[cnt])
> +			init_needed = 1;
>  	}
> 
>  	/* All required i_dquot has been initialized */
> --
> 2.20.1
> 
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ