f2fs: expose some sectors to user in inline data or dentry case
Subsystems (2)
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: expose some sectors to user in inline data or dentry case
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.
--- fs/f2fs/file.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/f2fs/file.c +5 -0
@@ -698,6 +698,11 @@ 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 (f2fs_has_inline_data (inode) ||f2fs_has_inline_dentry (inode)) + stat->blocks += (stat->size +511 ) >>9 ; +return 0 ; }
Signature · 1 line
2.14.0.rc1.383.gd1ce394fe2-goog
Quoted 5 lines · Jaegeuk Kim
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.Signed-off-by Jaegeuk Kim <[email protected]>
Thanks,
Quoted 21 lines
--- fs/f2fs/file.c | 5 +++++ 1 file changed, 5 insertions(+)fs/f2fs/file.c +5
-0@@ -698,6 +698,11 @@ 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 (f2fs_has_inline_data (inode) ||f2fs_has_inline_dentry (inode)) + stat->blocks += (stat->size +511 ) >>9 ; +return 0 ; }
Jaegeuk Kim
maintainerQuoted 22 lines · Chao Yu
Quoted 5 lines · Jaegeuk Kim
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.Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>Thanks,
Quoted 11 lines
--- fs/f2fs/file.c | 5 +++++ 1 file changed, 5 insertions(+)fs/f2fs/file.c +0
-0@@ -698,6 +698,11 @@ int f2fs_getattr(const struct path *path, struct kstat *stat, STATX_ATTR_NODUMP);
Quoted 4 lines
fs/f2fs/file.c int f2fs_getattr(const struct path *path, struct kstat *stat, · line 703
Quoted 4 lines
fs/f2fs/file.c +3
-0generic_fillattr (inode, stat); + +/* we need to show initial sectors used for inline_data/dentries */ +if (f2fs_has_inline_data (inode) ||f2fs_has_inline_dentry (inode))
FYI;
I added S_ISREG(inode->i_mode) with f2fs_has_inline_data() to avoid quotacheck error.
Quoted 6 lines
Quoted 6 lines
fs/f2fs/file.c +2
-0+ stat->blocks += (stat->size +511 ) >>9 ; +return 0 ; }
Quoted 23 lines · Jaegeuk Kim
Quoted 22 lines · Chao Yu
Quoted 5 lines · Jaegeuk Kim
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.Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>Thanks,
Quoted 11 lines
--- fs/f2fs/file.c | 5 +++++ 1 file changed, 5 insertions(+)fs/f2fs/file.c +0
-0@@ -698,6 +698,11 @@ int f2fs_getattr(const struct path *path, struct kstat *stat, STATX_ATTR_NODUMP);
Quoted 8 lines
Quoted 4 lines
fs/f2fs/file.c int f2fs_getattr(const struct path *path, struct kstat *stat, · line 703
Quoted 4 lines
fs/f2fs/file.c +3
-0generic_fillattr (inode, stat); + +/* we need to show initial sectors used for inline_data/dentries */ +if (f2fs_has_inline_data (inode) ||f2fs_has_inline_dentry (inode))FYI;
I addedS_ISREG(inode->i_mode)withf2fs_has_inline_data()to avoid quotacheck error.
If this patch is related to quotacheck issue, I doubt that there will be problemetic, in no journalled quota case, fs quota system won't stat blocks in inline file, however, after SPO, when using quotacheck to scan file to recover quota info, blocks of inline file showed in getattr can be stated into quota. That would be inconsistent.
Thanks,
Quoted 10 lines
Quoted 7 lines
fs/f2fs/file.c int f2fs_getattr(const struct path *path, struct kstat *stat, · line 708
Quoted 7 lines
fs/f2fs/file.c +2
-0+ stat->blocks += (stat->size +511 ) >>9 ; +return 0 ; }.
Jaegeuk Kim
maintainerQuoted 33 lines · Chao Yu
Quoted 23 lines · Jaegeuk Kim
Quoted 22 lines · Chao Yu
Quoted 5 lines · Jaegeuk Kim
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.Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>Thanks,
Quoted 11 lines
--- fs/f2fs/file.c | 5 +++++ 1 file changed, 5 insertions(+)fs/f2fs/file.c +0
-0@@ -698,6 +698,11 @@ int f2fs_getattr(const struct path *path, struct kstat *stat, STATX_ATTR_NODUMP);Quoted 8 lines
Quoted 4 lines
fs/f2fs/file.c int f2fs_getattr(const struct path *path, struct kstat *stat, · line 703
Quoted 4 lines
fs/f2fs/file.c +3
-0generic_fillattr (inode, stat); + +/* we need to show initial sectors used for inline_data/dentries */ +if (f2fs_has_inline_data (inode) ||f2fs_has_inline_dentry (inode))FYI;
I addedS_ISREG(inode->i_mode)withf2fs_has_inline_data()to avoid quotacheck error.
Quoted 5 lines
If this patch is related to quotacheck issue, I doubt that there will be problemetic, in no journalled quota case, fs quota system won't stat blocks in inline file, however, after SPO, when using quotacheck to scan file to recover quota info, blocks of inline file showed in getattr can be stated into quota. That would be inconsistent.
FWIW, quotacheck counts i_blocks via ioctl for normal files. Without this modification, xfstests gives an failure on quota cases.
Quoted 13 lines
Thanks,
Quoted 10 lines
Quoted 7 lines
fs/f2fs/file.c int f2fs_getattr(const struct path *path, struct kstat *stat, · line 708
Quoted 7 lines
fs/f2fs/file.c +2
-0+ stat->blocks += (stat->size +511 ) >>9 ; +return 0 ; }.
Chao Yu
maintainerQuoted 34 lines · Jaegeuk Kim
Quoted 33 lines · Chao Yu
Quoted 31 lines · Jaegeuk Kim
Quoted 22 lines · Chao Yu
Quoted 5 lines · Jaegeuk Kim
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.Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>Thanks,
Quoted 11 lines
--- fs/f2fs/file.c | 5 +++++ 1 file changed, 5 insertions(+)fs/f2fs/file.c +0
-0@@ -698,6 +698,11 @@ int f2fs_getattr(const struct path *path, struct kstat *stat, STATX_ATTR_NODUMP);Quoted 4 lines
fs/f2fs/file.c int f2fs_getattr(const struct path *path, struct kstat *stat, · line 703
Quoted 4 lines
fs/f2fs/file.c +3
-0generic_fillattr (inode, stat); + +/* we need to show initial sectors used for inline_data/dentries */ +if (f2fs_has_inline_data (inode) ||f2fs_has_inline_dentry (inode))FYI;
I addedS_ISREG(inode->i_mode)withf2fs_has_inline_data()to avoid quotacheck error.
Quoted 8 lines
Quoted 5 lines
If this patch is related to quotacheck issue, I doubt that there will be problemetic, in no journalled quota case, fs quota system won't stat blocks in inline file, however, after SPO, when using quotacheck to scan file to recover quota info, blocks of inline file showed in getattr can be stated into quota. That would be inconsistent.
FWIW, quotacheck counts
i_blocksvia ioctl for normal files. Without this modification, xfstests gives an failure on quota cases.
OK, let's fix this issue first. ;)
Thanks,
Quoted 23 lines
Quoted 14 lines
Thanks,
Quoted 10 lines
Quoted 7 lines
fs/f2fs/file.c int f2fs_getattr(const struct path *path, struct kstat *stat, · line 708
Quoted 7 lines
fs/f2fs/file.c +2
-0+ stat->blocks += (stat->size +511 ) >>9 ; +return 0 ; }.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel