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: <20130313195422.GG5604@thunk.org>
Date:	Wed, 13 Mar 2013 15:54:22 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	Zheng Liu <gnehzuil.liu@...il.com>
Cc:	linux-ext4@...r.kernel.org, Zheng Liu <wenqing.lz@...bao.com>
Subject: Re: [PATCH 1/2] e4defrag: defrag a file when orig_physical_cnt ==
 donor_physical_cnt

On Mon, Mar 04, 2013 at 12:26:17AM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@...bao.com>
> 
> When orig_physical_cnt == donor_physical_cnt, we need to defrag a file
> because a file could be written backwards.  So that will make it look
> like a contiguous extent but actually the physical blocks are reversed.

The problem with your change is in the case where orig_physical_cnt
and donor_physical_cnt are 1 (i.e., the file is perfectly defragged),
we will still try to swap the extents.

The fundamental problem is that we are using a metric which is flawed;
in the case of the following file:

> File size of /mnt/sda3/testfile is 40960 (10 blocks of 4096 bytes)
>  ext:     logical_offset:        physical_offset: length:   expected: flags:
>    0:        0..       0:      34825..     34825:      1:
>    1:        1..       1:      34824..     34824:      1:      34826:
>    2:        2..       2:      34823..     34823:      1:      34825:
>    3:        3..       3:      34822..     34822:      1:      34824:
>    4:        4..       4:      34821..     34821:      1:      34823:
>    5:        5..       5:      34820..     34820:      1:      34822:
>    6:        6..       6:      34819..     34819:      1:      34821:
>    7:        7..       7:      34818..     34818:      1:      34820:
>    8:        8..       8:      34817..     34817:      1:      34819:
>    9:        9..       9:      34816..     34816:      1:      34818: eof

We should be counting this as having 10 extents, not 1.

   	     	      	      	     		     - Ted
--
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