[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 1 Jan 2013 15:38:58 -0500
From: Theodore Ts'o <tytso@....edu>
To: Zheng Liu <gnehzuil.liu@...il.com>
Cc: linux-ext4@...r.kernel.org, George Spelvin <linux@...izon.com>,
Zheng Liu <wenqing.lz@...bao.com>
Subject: Re: [PATCH 2/2 v2] debugfs: dump a sparse file as a new sparse file
On Tue, Jan 01, 2013 at 08:30:15PM +0800, Zheng Liu wrote:
> +errcode_t ext2fs_file_read2(ext2_file_t file, void *buf,
> + unsigned int wanted, unsigned int *got,
> + ext2_off64_t *seek)
I'm a bit concenred about this abstraction. Consider what happens if
wanted is greater than a block size --- for example, consider if
wanted is 16k, and every other 1k block is uninitialized.
Then ext2fs_file_read2() will return *got set to 8k, and *seek set to
8k, and the buffer will contain the blocks that are initialized packed
up right against each other.
Worse, ext2fs_file_read() will do the same thing, so this commit
changes how ext2fs_file_read() functions, and a program which expects
to get the correct contents from the file will malfunction.
- 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