lkml.org 
[lkml]   [2017]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] f2fs: expose some sectors to user in inline data or dentry case
On 10/16, Chao Yu wrote:
> On 2017/10/14 1:31, Jaegeuk Kim wrote:
> > 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 <jaegeuk@kernel.org>
>
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>
> Thanks,
>
> > ---
> > fs/f2fs/file.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> > index 2eb3efe92018..f7be6c394fa8 100644
> > --- a/fs/f2fs/file.c
> > +++ b/fs/f2fs/file.c
> > @@ -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))

FYI;
I added S_ISREG(inode->i_mode) with f2fs_has_inline_data() to avoid quotacheck
error.

> > + stat->blocks += (stat->size + 511) >> 9;
> > +
> > return 0;
> > }
> >
> >

\
 
 \ /
  Last update: 2017-10-18 00:03    [W:1.975 / U:1.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site