diff options
author | Dmitry Monakhov <dmonakhov@sw.ru> | 2007-10-16 04:25:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:55 -0400 |
commit | 8268f5a7415d914fc855a86aa2284ac819dc6b2e (patch) | |
tree | 13628a6d3cb31f04472c4cccdc741979ecdf0ad0 /drivers | |
parent | afddba49d18f346e5cc2938b6ed7c512db18ca68 (diff) |
deny partial write for loop dev fd
Partial write can be easily supported by LO_CRYPT_NONE mode, but it is not
easy in LO_CRYPT_CRYPTOAPI case, because of its block nature. I don't know
who still used cryptoapi, but theoretically it is possible. So let's leave
things as they are. Loop device doesn't support partial write before
Nick's "write_begin/write_end" patch set, and let's it behave the same way
after.
Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/loop.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index a5f993ac28dd..e5a051577a5e 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -245,10 +245,8 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec, | |||
245 | 245 | ||
246 | ret = pagecache_write_end(file, mapping, pos, size, copied, | 246 | ret = pagecache_write_end(file, mapping, pos, size, copied, |
247 | page, fsdata); | 247 | page, fsdata); |
248 | if (ret < 0) | 248 | if (ret < 0 || ret != copied) |
249 | goto fail; | 249 | goto fail; |
250 | if (ret < copied) | ||
251 | copied = ret; | ||
252 | 250 | ||
253 | if (unlikely(transfer_result)) | 251 | if (unlikely(transfer_result)) |
254 | goto fail; | 252 | goto fail; |