[<prev] [next>] [day] [month] [year] [list]
Message-ID: <87y7n3909x.fsf@sw.ru>
Date: Mon, 12 Feb 2007 12:46:02 +0300
From: Dmitriy Monakhov <dmonakhov@...ru>
To: Linux Kernel <linux-kernel@...r.kernel.org>
CC: Linux Filesystems <linux-fsdevel@...r.kernel.org>,
linux-ext4@...r.kernel.org, devel@...nvz.org
Subject: [PATCH 0/1][RFC] prepare_write positive return value V(2)
Changes from ver(1)
- __page_symlink(): In order to be on a safe side add explicit zeroing content
before fail (just in case).
-do_lo_send_aops(): If prepare_write can't handle total size of bytes requested
from loop_dev it is safer to fail.
- pipe_to_file(): Limit the size of the copy to size wich prepare_write ready
to handle. instead of failing.
- ecryptfs: was't changed in this version, because where is no even
AOP_TRUNCATED_PAGE handling code where.
Almost all read/write operation handles data with chunks(segments or pages)
and result has integral behaviour for folowing scenario:
for_each_chunk() {
res = op(....);
if(IS_ERROR(res))
return progress ? progress : res;
progress += res;
}
prepare_write may has integral behaviour in case of blksize < pgsize,
for example we successfully allocated/read some blocks, but not all of them,
and than some error happend. Currently we eliminate this progress by doing
vmtrunate() after prepare_has failed.
It is good to have ability to signal about this progress. Interprete positive
prepare_write() ret code as bytes num that fs ready to handle at this moment.
BTH: This approach was used in OpenVZ 2.6.9 kernel in order to make FS with
delayed allocation more correct, and its works well.
I think not everybody will happy about this, but let's discuss all advantages
and disadvantages of this change.
fixes not dirrectly connected with proposed prepare_write semantic changes:
__page_symlink : If find_or_create_page has failed on second retry attempt
function will exit with wrong error code.
__generic_cont_expand: Add correct AOP_TRUNCATED_PAGE handling.
Signed-off-by: Dmitriy Monakhov <dmonakhov@...nvz.org>
-------------
View attachment "diff-ms-fs-prepare_write-retval5" of type "text/plain" (4715 bytes)
Powered by blists - more mailing lists