android_kernel_xiaomi_sm7250/fs/gfs2
Andreas Gruenbacher 31cae2359d gfs2: Fix filesystem block deallocation for short writes
[ Upstream commit d031a8866e709c9d1ee5537a321b6192b4d2dc5b ]

When a write cannot be carried out in full, gfs2_iomap_end() releases
blocks that have been allocated for this write but haven't been used.

To compute the end of the allocation, gfs2_iomap_end() incorrectly
rounded the end of the attempted write down to the next block boundary
to arrive at the end of the allocation.  It would have to round up, but
the end of the allocation is also available as iomap->offset +
iomap->length, so just use that instead.

In addition, use round_up() for computing the start of the unused range.

Fixes: 64bc06bb32 ("gfs2: iomap buffered write support")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-18 09:42:48 +02:00
..
acl.c
acl.h
aops.c
aops.h
bmap.c gfs2: Fix filesystem block deallocation for short writes 2022-05-18 09:42:48 +02:00
bmap.h
dentry.c
dir.c
dir.h
export.c
file.c
gfs2.h
glock.c
glock.h
glops.c
glops.h
incore.h
inode.c
inode.h
Kconfig
lock_dlm.c
log.c
log.h
lops.c
lops.h
main.c
Makefile
meta_io.c
meta_io.h
ops_fstype.c
quota.c
quota.h
recovery.c
recovery.h
rgrp.c gfs2: assign rgrp glock before compute_bitstructs 2022-04-27 13:39:42 +02:00
rgrp.h
super.c
super.h
sys.c
sys.h
trace_gfs2.h
trans.c
trans.h
util.c
util.h
xattr.c
xattr.h