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: <20130201025120.GA10176@gmail.com>
Date:	Fri, 1 Feb 2013 10:51:20 +0800
From:	Zheng Liu <gnehzuil.liu@...il.com>
To:	Jan Kara <jack@...e.cz>
Cc:	linux-ext4@...r.kernel.org, Zheng Liu <wenqing.lz@...bao.com>,
	Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH 4/9 v4] ext4: adjust interfaces of extent status tree

On Thu, Jan 31, 2013 at 05:02:06PM +0100, Jan Kara wrote:
[snip]
> > @@ -465,6 +490,9 @@ static int __es_remove_extent(struct ext4_es_tree *tree, ext4_lblk_t lblk,
> >  
> >  			newes.es_lblk = end + 1;
> >  			newes.es_len = len2;
> > +			newes.es_pblk = ext4_es_get_pblock(&orig_es,
> > +				orig_es.es_pblk + orig_es.es_len - len2);
> > +			newes.es_status = orig_es.es_status;
> >  			err = __es_insert_extent(tree, &newes);
> >  			if (err) {
> >  				es->es_lblk = orig_es.es_lblk;
> > @@ -474,6 +502,8 @@ static int __es_remove_extent(struct ext4_es_tree *tree, ext4_lblk_t lblk,
> >  		} else {
> >  			es->es_lblk = end + 1;
> >  			es->es_len = len2;
> > +			es->es_pblk = ext4_es_get_pblock(es,
> > +				orig_es.es_pblk + orig_es.es_len - len2);
> >  		}
> >  		goto out;
> >  	}
> > @@ -498,9 +528,13 @@ static int __es_remove_extent(struct ext4_es_tree *tree, ext4_lblk_t lblk,
> >  	}
> >  
> >  	if (es && es->es_lblk < end + 1) {
> > +		ext4_lblk_t orig_len = es->es_len;
> > +
> >  		len1 = ext4_es_end(es) - end;
> >  		es->es_lblk = end + 1;
> >  		es->es_len = len1;
> > +		es->es_pblk = ext4_es_get_pblock(es,
> > +						 es->es_pblk + orig_len - len1);
> >  	}
> >  
> >  out:
>   So ext4_es_get_pblock() seems a bit confusing. I understand that for
> delayed extents physical block doesn't make sence and that you wanted to
> save some typing by that function but IMHO it's making the code less
> readable. I'd rather see there e.g.:
>   if (!ext4_es_is_delayed(es))
> 	es->es_pblk += orig_len - len1;
> and for delayed extents we can just leave es_pblk undefined because nobody
> should really look at it anyway.

Agree.  It will be fixed in next version.

Thanks,
                                                - Zheng
--
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