3.16.54-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Jaegeuk Kim <[email protected]>

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.

Reviewed-by: Chao Yu <[email protected]>
[Jaegeuk Kim: avoid link file for quotacheck]
Signed-off-by: Jaegeuk Kim <[email protected]>
[bwh: Backported to 3.16:
 - Inline dentries are not supported
 - Adjust context]
Signed-off-by: Ben Hutchings <[email protected]>
---
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -460,6 +460,11 @@ int f2fs_getattr(struct vfsmount *mnt,
        struct inode *inode = dentry->d_inode;
        generic_fillattr(inode, stat);
        stat->blocks <<= 3;
+
+       /* we need to show initial sectors used for inline_data/dentries */
+       if (S_ISREG(inode->i_mode) && f2fs_has_inline_data(inode))
+               stat->blocks += (stat->size + 511) >> 9;
+
        return 0;
 }
 

Reply via email to