Skip to content

Commit a717135

Browse files
Jaegeuk Kimpundiramit
authored andcommitted
FROMLIST: f2fs: expose some sectors to user in inline data or dentry case
(from https://patchwork.kernel.org/patch/10005409/) 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. Bug: 67651285 Bug: 67600404 Change-Id: I9ad5cb137eb627b9fd22740d2ab98e0221433c95 Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent c7fa8b7 commit a717135

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fs/f2fs/file.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,11 @@ int f2fs_getattr(struct vfsmount *mnt,
665665
{
666666
struct inode *inode = d_inode(dentry);
667667
generic_fillattr(inode, stat);
668+
669+
/* we need to show initial sectors used for inline_data/dentries */
670+
if (f2fs_has_inline_data(inode) || f2fs_has_inline_dentry(inode))
671+
stat->blocks += (stat->size + 511) >> 9;
672+
668673
return 0;
669674
}
670675

0 commit comments

Comments
 (0)