mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-05 17:13:47 +01:00
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 <[email protected]> Cc: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
afddba49d1
commit
8268f5a741
1 file changed
+1
-3
@@ -245,10 +245,8 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec,
|
||||
|
||||
ret = pagecache_write_end(file, mapping, pos, size, copied,
|
||||
page, fsdata);
|
||||
if (ret < 0)
|
||||
if (ret < 0 || ret != copied)
|
||||
goto fail;
|
||||
if (ret < copied)
|
||||
copied = ret;
|
||||
|
||||
if (unlikely(transfer_result))
|
||||
goto fail;
|
||||
|
||||
Reference in new issue
Block a user