linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: expose some sectors to user in inline data or dentry case
@ 2017-10-13 17:31 Jaegeuk Kim
  2017-10-16  3:11 ` Chao Yu
  0 siblings, 1 reply; 6+ messages in thread
From: Jaegeuk Kim @ 2017-10-13 17:31 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: 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 <jaegeuk@kernel.org>
---
 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))
+		stat->blocks += (stat->size + 511) >> 9;
+
 	return 0;
 }
 
-- 
2.14.0.rc1.383.gd1ce394fe2-goog

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] f2fs: expose some sectors to user in inline data or dentry case
  2017-10-13 17:31 [PATCH] f2fs: expose some sectors to user in inline data or dentry case Jaegeuk Kim
@ 2017-10-16  3:11 ` Chao Yu
  2017-10-17 22:03   ` Jaegeuk Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Chao Yu @ 2017-10-16  3:11 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-fsdevel, linux-f2fs-devel

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))
> +		stat->blocks += (stat->size + 511) >> 9;
> +
>  	return 0;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] f2fs: expose some sectors to user in inline data or dentry case
  2017-10-16  3:11 ` Chao Yu
@ 2017-10-17 22:03   ` Jaegeuk Kim
  2017-10-18  2:32     ` Chao Yu
  0 siblings, 1 reply; 6+ messages in thread
From: Jaegeuk Kim @ 2017-10-17 22:03 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel

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;
> >  }
> >  
> > 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] f2fs: expose some sectors to user in inline data or dentry case
  2017-10-17 22:03   ` Jaegeuk Kim
@ 2017-10-18  2:32     ` Chao Yu
  2017-10-19 19:12       ` Jaegeuk Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Chao Yu @ 2017-10-18  2:32 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel

On 2017/10/18 6:03, Jaegeuk Kim wrote:
> 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.

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,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] f2fs: expose some sectors to user in inline data or dentry case
  2017-10-18  2:32     ` Chao Yu
@ 2017-10-19 19:12       ` Jaegeuk Kim
  2017-10-23 10:11         ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 6+ messages in thread
From: Jaegeuk Kim @ 2017-10-19 19:12 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel

On 10/18, Chao Yu wrote:
> On 2017/10/18 6:03, Jaegeuk Kim wrote:
> > 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.
> 
> 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.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: expose some sectors to user in inline data or dentry case
  2017-10-19 19:12       ` Jaegeuk Kim
@ 2017-10-23 10:11         ` Chao Yu
  0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2017-10-23 10:11 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

On 2017/10/20 3:12, Jaegeuk Kim wrote:
> On 10/18, Chao Yu wrote:
>> On 2017/10/18 6:03, Jaegeuk Kim wrote:
>>> 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.
>>
>> 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.

OK, let's fix this issue first. ;)

Thanks,

> 
>>
>> Thanks,
>>
>>>
>>>>> +		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
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-23 10:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13 17:31 [PATCH] f2fs: expose some sectors to user in inline data or dentry case Jaegeuk Kim
2017-10-16  3:11 ` Chao Yu
2017-10-17 22:03   ` Jaegeuk Kim
2017-10-18  2:32     ` Chao Yu
2017-10-19 19:12       ` Jaegeuk Kim
2017-10-23 10:11         ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).