[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4C7E0F15.40007@sx.jp.nec.com>
Date: Wed, 01 Sep 2010 17:30:13 +0900
From: Kazuya Mio <k-mio@...jp.nec.com>
To: Andreas Rid <andreas@...-net.de>
CC: ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [patch] e4defrag: relevant file fragmentation with base_file
2010/08/30 4:47, Andreas Rid wrote:
> @@ -2327,8 +2320,44 @@ int main(int argc, char *argv[])
> } else
> printf("ext4 defragmentation for %s\n",
> argv[i]);
> - /* Defrag single file process */
> - file_defrag(argv[i],&buf, FTW_F, NULL);
> +
> + if (mode_flag& RELEVANT&& i == optind) {
> + if (i - argc == 1)
> + /* not enought arguemnts */
> + goto out;
I think this condition should be "argc - optind == 1" because "i" is smaller
than argc at all times.
> + goto out;
> + }
> +
> + r_pstart = get_physical_offset(fd,&ret);
If e4defrag is executed with the following arguments, e4defrag will move the
extents of "move_file" near the "directory".
# e4defrag -r base_file directory move_file
To prevent this case, r_pstart should not be changed even if directories or
devices are set to the argument of e4defrag after the physical block number of
the "base_file" was assigned to r_pstart.
I will fix your patch in above way. Any comments?
Regards,
Kazuya Mio
--
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