Revert "ext4: dax: fix overflowing extents beyond inode size when partially writing"
This reverts commit f8a7c34232
which is
commit dda898d7ffe85931f9cca6d702a51f33717c501e upstream.
It breaks the Android kernel tests, and can be brought back in the future
if it is really needed.
Bug: 161946584
Change-Id: I8c5a06731ef7830612591c6f818ac69cf169d78a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
5d9c84863f
commit
f46870ab3d
@ -310,10 +310,10 @@ static ssize_t ext4_handle_inode_extension(struct inode *inode, loff_t offset,
|
||||
* Clean up the inode after DIO or DAX extending write has completed and the
|
||||
* inode size has been updated using ext4_handle_inode_extension().
|
||||
*/
|
||||
static void ext4_inode_extension_cleanup(struct inode *inode, bool need_trunc)
|
||||
static void ext4_inode_extension_cleanup(struct inode *inode, ssize_t count)
|
||||
{
|
||||
lockdep_assert_held_write(&inode->i_rwsem);
|
||||
if (need_trunc) {
|
||||
if (count < 0) {
|
||||
ext4_truncate_failed_write(inode);
|
||||
/*
|
||||
* If the truncate operation failed early, then the inode may
|
||||
@ -550,7 +550,7 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
||||
* writeback of delalloc blocks.
|
||||
*/
|
||||
WARN_ON_ONCE(ret == -EIOCBQUEUED);
|
||||
ext4_inode_extension_cleanup(inode, ret < 0);
|
||||
ext4_inode_extension_cleanup(inode, ret);
|
||||
}
|
||||
|
||||
out:
|
||||
@ -634,7 +634,7 @@ ext4_dax_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
||||
|
||||
if (extend) {
|
||||
ret = ext4_handle_inode_extension(inode, offset, ret);
|
||||
ext4_inode_extension_cleanup(inode, ret < (ssize_t)count);
|
||||
ext4_inode_extension_cleanup(inode, ret);
|
||||
}
|
||||
out:
|
||||
inode_unlock(inode);
|
||||
|
Loading…
Reference in New Issue
Block a user