Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40f3c627 authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Amit Pundir
Browse files

UPSTREAM: f2fs: expose some sectors to user in inline data or dentry case



commit 5b4267d195dd887c4412e34b5a7365baa741b679 upstream.

If there's some data written through inline data or dentry, we need to shouw
st_blocks. This fixes reporting zero blocks even though there is small written
data.

Cc: stable@vger.kernel.org
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: avoid link file for quotacheck]
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>

Bug: 67651285
Bug: 67600404
Change-Id: I9ad5cb137eb627b9fd22740d2ab98e0221433c95
parent b657a6f6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -683,6 +683,12 @@ int f2fs_getattr(const struct path *path, struct kstat *stat,
				  STATX_ATTR_NODUMP);

	generic_fillattr(inode, stat);

	/* we need to show initial sectors used for inline_data/dentries */
	if ((S_ISREG(inode->i_mode) && f2fs_has_inline_data(inode)) ||
					f2fs_has_inline_dentry(inode))
		stat->blocks += (stat->size + 511) >> 9;

	return 0;
}