All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] fsck.f2fs: check only max extra_isize
@ 2019-08-17  1:03 Jaegeuk Kim
  2019-08-18 12:34 ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2019-08-17  1:03 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim

If we use later kernel having larger extra_isize, old fsck will delete
entire old files.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fsck/fsck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index 1708abe..b4e53db 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -731,7 +731,7 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
 	if (f2fs_has_extra_isize(&node_blk->i)) {
 		if (c.feature & cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR)) {
 			if (node_blk->i.i_extra_isize >
-				cpu_to_le16(F2FS_TOTAL_EXTRA_ATTR_SIZE)) {
+						4 * DEF_ADDRS_PER_INODE) {
 				FIX_MSG("ino[0x%x] recover i_extra_isize "
 					"from %u to %u",
 					nid,
-- 
2.19.0.605.g01d371f741-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH] fsck.f2fs: check only max extra_isize
  2019-08-17  1:03 [f2fs-dev] [PATCH] fsck.f2fs: check only max extra_isize Jaegeuk Kim
@ 2019-08-18 12:34 ` Chao Yu
  2019-08-20  1:16   ` Jaegeuk Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu @ 2019-08-18 12:34 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-f2fs-devel

On 2019-8-17 9:03, Jaegeuk Kim wrote:
> If we use later kernel having larger extra_isize, old fsck will delete
> entire old files.

Would it be better to construct the length based on existed features?

Thanks,

> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fsck/fsck.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fsck/fsck.c b/fsck/fsck.c
> index 1708abe..b4e53db 100644
> --- a/fsck/fsck.c
> +++ b/fsck/fsck.c
> @@ -731,7 +731,7 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
>  	if (f2fs_has_extra_isize(&node_blk->i)) {
>  		if (c.feature & cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR)) {
>  			if (node_blk->i.i_extra_isize >
> -				cpu_to_le16(F2FS_TOTAL_EXTRA_ATTR_SIZE)) {
> +						4 * DEF_ADDRS_PER_INODE) {
>  				FIX_MSG("ino[0x%x] recover i_extra_isize "
>  					"from %u to %u",
>  					nid,
> 


_______________________________________________
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] 4+ messages in thread

* Re: [f2fs-dev] [PATCH] fsck.f2fs: check only max extra_isize
  2019-08-18 12:34 ` Chao Yu
@ 2019-08-20  1:16   ` Jaegeuk Kim
  2019-08-20  9:16     ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2019-08-20  1:16 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-f2fs-devel

On 08/18, Chao Yu wrote:
> On 2019-8-17 9:03, Jaegeuk Kim wrote:
> > If we use later kernel having larger extra_isize, old fsck will delete
> > entire old files.
> 
> Would it be better to construct the length based on existed features?

We can't judge the size for future fields.

> 
> Thanks,
> 
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >  fsck/fsck.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fsck/fsck.c b/fsck/fsck.c
> > index 1708abe..b4e53db 100644
> > --- a/fsck/fsck.c
> > +++ b/fsck/fsck.c
> > @@ -731,7 +731,7 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
> >  	if (f2fs_has_extra_isize(&node_blk->i)) {
> >  		if (c.feature & cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR)) {
> >  			if (node_blk->i.i_extra_isize >
> > -				cpu_to_le16(F2FS_TOTAL_EXTRA_ATTR_SIZE)) {
> > +						4 * DEF_ADDRS_PER_INODE) {
> >  				FIX_MSG("ino[0x%x] recover i_extra_isize "
> >  					"from %u to %u",
> >  					nid,
> > 


_______________________________________________
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] 4+ messages in thread

* Re: [f2fs-dev] [PATCH] fsck.f2fs: check only max extra_isize
  2019-08-20  1:16   ` Jaegeuk Kim
@ 2019-08-20  9:16     ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2019-08-20  9:16 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu; +Cc: linux-f2fs-devel

On 2019/8/20 9:16, Jaegeuk Kim wrote:
> On 08/18, Chao Yu wrote:
>> On 2019-8-17 9:03, Jaegeuk Kim wrote:
>>> If we use later kernel having larger extra_isize, old fsck will delete
>>> entire old files.
>>
>> Would it be better to construct the length based on existed features?
> 
> We can't judge the size for future fields.

Alright, it's okay to just check it with the maximum value, though I think it
needs to consider inline xattr space as well.

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,


_______________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2019-08-20  9:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-17  1:03 [f2fs-dev] [PATCH] fsck.f2fs: check only max extra_isize Jaegeuk Kim
2019-08-18 12:34 ` Chao Yu
2019-08-20  1:16   ` Jaegeuk Kim
2019-08-20  9:16     ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.