f2fs: don't clear CP_QUOTA_NEED_FSCK_FLAG
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: don't clear CP_QUOTA_NEED_FSCK_FLAG
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)
fs/f2fs/checkpoint.c +0 -2
@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );
Signature · 1 line
2.19.0.605.g01d371f741-goog
Quoted 13 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 5 lines
fs/f2fs/checkpoint.c +0
-2@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );
I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag CP_QUOTA_NEED_FSCK_FLAG in CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove this NEED_FSCK flag..?
Thanks,
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );
Jaegeuk Kim
maintainerQuoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)
Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?
I said it's subtle. So, I guessed 1) set CP_QUOTA_NEED_FSCK_FLAG, 2) clear SBI_QUOTA_SKIP_FLUSH by checkpoint, 3) clear CP_QUOTA_NEED_FSCK_FLAG by another checkpoint?
Quoted 7 lines
Thanks,
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );
Quoted 26 lines · Jaegeuk Kim
Quoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?
Quoted 1 line
I said it's subtle. So, I guessed 1) set
CP_QUOTA_NEED_FSCK_FLAG, 2) clear
I know it's subtle... and I agreed we can fix it like this in upstream first, but in our product, it's not rare that we hit the QUOTA_SKIP_FLUSH(its value is 4) case, later we may encounter long latency caused by quota repairing of fsck.
Quoted 2 lines
SBI_QUOTA_SKIP_FLUSHby checkpoint, 3) clearCP_QUOTA_NEED_FSCK_FLAGby another checkpoint?
But later if QUOTA_NEED_REPAIR is set, we will set QUOTA_NEED_FSCK_FLAG again, right?
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
So in order to figure out whether this is caused by out-of-order execution of below assignments:
if (is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag later
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag first
Could you have a try:
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR) || is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); else __clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
Thanks,
Quoted 11 lines
Quoted 8 lines
Thanks,
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );.
Jaegeuk Kim
maintainerQuoted 56 lines · Chao Yu
Quoted 26 lines · Jaegeuk Kim
Quoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?Quoted 1 line
I said it's subtle. So, I guessed 1) set
CP_QUOTA_NEED_FSCK_FLAG, 2) clearI know it's subtle... and I agreed we can fix it like this in upstream first, but in our product, it's not rare that we hit the
QUOTA_SKIP_FLUSH(its value is 4)case, later we may encounter long latency caused by quota repairing of fsck.Quoted 2 lines
SBI_QUOTA_SKIP_FLUSHby checkpoint, 3) clearCP_QUOTA_NEED_FSCK_FLAGby another checkpoint?But later if
QUOTA_NEED_REPAIRis set, we will setQUOTA_NEED_FSCK_FLAGagain, right?if (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);So in order to figure out whether this is caused by out-of-order execution of below assignments:
if (
is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag first
Quoted 7 lines
Could you have a try:
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR) || is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); else __clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
What does this mean? I'm in doubt we have a missing case where we clear this flag, CP_QUOTA_NEED_FSCK_FLAG.
Quoted 14 lines
Thanks,
Quoted 11 lines
Quoted 8 lines
Thanks,
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );.
Quoted 59 lines · Jaegeuk Kim
Quoted 58 lines · Chao Yu
Quoted 26 lines · Jaegeuk Kim
Quoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?Quoted 1 line
I said it's subtle. So, I guessed 1) set
CP_QUOTA_NEED_FSCK_FLAG, 2) clearI know it's subtle... and I agreed we can fix it like this in upstream first, but in our product, it's not rare that we hit the
QUOTA_SKIP_FLUSH(its value is 4)case, later we may encounter long latency caused by quota repairing of fsck.Quoted 2 lines
SBI_QUOTA_SKIP_FLUSHby checkpoint, 3) clearCP_QUOTA_NEED_FSCK_FLAGby another checkpoint?But later if
QUOTA_NEED_REPAIRis set, we will setQUOTA_NEED_FSCK_FLAGagain, right?if (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);So in order to figure out whether this is caused by out-of-order execution of below assignments:
if (
is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstCould you have a try:
Quoted 7 lines
Quoted 5 lines
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR) || is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); else __clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);What does this mean? I'm in doubt we have a missing case where we clear this
Cpu pipeline / compiler can make code out-of-order execution, which means:
a = 1;
b = 2;
may actually be executed as the order of:
b = 2;
a = 1;
So I doubt that below two line codes can be executed out-of-order:
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag later
if ()
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag first
Quoted 1 line
flag,
CP_QUOTA_NEED_FSCK_FLAG.
Agreed, I've checked each operation in f2fs_quota_operations yesterday, and didn't find any missing places yet...
Thanks,
Quoted 18 lines
Quoted 15 lines
Thanks,
Quoted 11 lines
Quoted 8 lines
Thanks,
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );.
.
Quoted 83 lines · Chao Yu
Quoted 59 lines · Jaegeuk Kim
Quoted 58 lines · Chao Yu
Quoted 26 lines · Jaegeuk Kim
Quoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?Quoted 1 line
I said it's subtle. So, I guessed 1) set
CP_QUOTA_NEED_FSCK_FLAG, 2) clearI know it's subtle... and I agreed we can fix it like this in upstream first, but in our product, it's not rare that we hit the
QUOTA_SKIP_FLUSH(its value is 4)case, later we may encounter long latency caused by quota repairing of fsck.Quoted 2 lines
SBI_QUOTA_SKIP_FLUSHby checkpoint, 3) clearCP_QUOTA_NEED_FSCK_FLAGby another checkpoint?But later if
QUOTA_NEED_REPAIRis set, we will setQUOTA_NEED_FSCK_FLAGagain, right?if (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);So in order to figure out whether this is caused by out-of-order execution of below assignments:
if (
is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstCould you have a try:
Quoted 7 lines
Quoted 5 lines
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR) || is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); else __clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);What does this mean? I'm in doubt we have a missing case where we clear this
Cpu pipeline / compiler can make code out-of-order execution, which means:
a = 1;
b = 2;may actually be executed as the order of:
b = 2;
a = 1;So I doubt that below two line codes can be executed out-of-order:
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag later
Quoted 7 lines
if ()
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstQuoted 1 line
flag,
CP_QUOTA_NEED_FSCK_FLAG.Agreed, I've checked each operation in
f2fs_quota_operationsyesterday, and didn't find any missing places yet...
Oh, I mean the place where set SBI_QUOTA_NEED_REPAIR, I also doubt we missed to set the flag.
Thanks,
Quoted 31 lines
Thanks,
Quoted 9 lines
Quoted 9 lines
Thanks,
Quoted 5 lines
Quoted 5 lines
Thanks,
Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1272
Quoted 3 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );.
.
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
Jaegeuk Kim
maintainerQuoted 79 lines · Chao Yu
Quoted 78 lines · Chao Yu
Quoted 59 lines · Jaegeuk Kim
Quoted 58 lines · Chao Yu
Quoted 26 lines · Jaegeuk Kim
Quoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?Quoted 1 line
I said it's subtle. So, I guessed 1) set
CP_QUOTA_NEED_FSCK_FLAG, 2) clearI know it's subtle... and I agreed we can fix it like this in upstream first, but in our product, it's not rare that we hit the
QUOTA_SKIP_FLUSH(its value is 4)case, later we may encounter long latency caused by quota repairing of fsck.Quoted 2 lines
SBI_QUOTA_SKIP_FLUSHby checkpoint, 3) clearCP_QUOTA_NEED_FSCK_FLAGby another checkpoint?But later if
QUOTA_NEED_REPAIRis set, we will setQUOTA_NEED_FSCK_FLAGagain, right?if (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);So in order to figure out whether this is caused by out-of-order execution of below assignments:
if (
is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstCould you have a try:
Quoted 7 lines
Quoted 5 lines
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR) || is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); else __clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);What does this mean? I'm in doubt we have a missing case where we clear this
Cpu pipeline / compiler can make code out-of-order execution, which means:
a = 1;
b = 2;may actually be executed as the order of:
b = 2;
a = 1;
Quoted 7 lines
Quoted 7 lines
So I doubt that below two line codes can be executed out-of-order:
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif ()
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag first
In spin_lock_irqsave()?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
flag,
CP_QUOTA_NEED_FSCK_FLAG.Agreed, I've checked each operation in
f2fs_quota_operationsyesterday, and didn't find any missing places yet...Oh, I mean the place where set
SBI_QUOTA_NEED_REPAIR, I also doubt we missed to set the flag.
So, I may need to keep this patch untill we find the missing case. I'll keep an eye on this.
Quoted 34 lines
Thanks,
Quoted 31 lines
Thanks,
Quoted 9 lines
Quoted 9 lines
Thanks,
Quoted 5 lines
Quoted 5 lines
Thanks,
Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
fs/f2fs/checkpoint.c
Quoted 3 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );.
.
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
Quoted 82 lines · Jaegeuk Kim
Quoted 81 lines · Chao Yu
Quoted 80 lines · Chao Yu
Quoted 59 lines · Jaegeuk Kim
Quoted 58 lines · Chao Yu
Quoted 26 lines · Jaegeuk Kim
Quoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?Quoted 1 line
I said it's subtle. So, I guessed 1) set
CP_QUOTA_NEED_FSCK_FLAG, 2) clearI know it's subtle... and I agreed we can fix it like this in upstream first, but in our product, it's not rare that we hit the
QUOTA_SKIP_FLUSH(its value is 4)case, later we may encounter long latency caused by quota repairing of fsck.Quoted 2 lines
SBI_QUOTA_SKIP_FLUSHby checkpoint, 3) clearCP_QUOTA_NEED_FSCK_FLAGby another checkpoint?But later if
QUOTA_NEED_REPAIRis set, we will setQUOTA_NEED_FSCK_FLAGagain, right?if (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);So in order to figure out whether this is caused by out-of-order execution of below assignments:
if (
is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstCould you have a try:
Quoted 7 lines
Quoted 5 lines
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR) || is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); else __clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);What does this mean? I'm in doubt we have a missing case where we clear this
Cpu pipeline / compiler can make code out-of-order execution, which means:
a = 1;
b = 2;may actually be executed as the order of:
b = 2;
a = 1;So I doubt that below two line codes can be executed out-of-order:
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif ()
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstIn
spin_lock_irqsave()?
Not sure in coverage of spin_lock, system can guarantee codes being executed orderly.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
flag,
CP_QUOTA_NEED_FSCK_FLAG.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Agreed, I've checked each operation in
f2fs_quota_operationsyesterday, and didn't find any missing places yet...Oh, I mean the place where set
SBI_QUOTA_NEED_REPAIR, I also doubt we missed to set the flag.So, I may need to keep this patch untill we find the missing case. I'll keep an eye on this.
Agreed, do you mind adding one line comment there to notice that?
Thanks,
Quoted 38 lines
Quoted 35 lines
Thanks,
Quoted 31 lines
Thanks,
Quoted 9 lines
Quoted 9 lines
Thanks,
Quoted 5 lines
Quoted 5 lines
Thanks,
Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
fs/f2fs/checkpoint.c
Quoted 3 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );.
.
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
.
Jaegeuk Kim
maintainerQuoted 101 lines · Chao Yu
Quoted 82 lines · Jaegeuk Kim
Quoted 81 lines · Chao Yu
Quoted 80 lines · Chao Yu
Quoted 59 lines · Jaegeuk Kim
Quoted 58 lines · Chao Yu
Quoted 26 lines · Jaegeuk Kim
Quoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)Quoted 9 lines
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-2if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );I didn't get it, previously, if we didn't persist all quota file's data in checkpoint, then we will tag
CP_QUOTA_NEED_FSCK_FLAGin CP area, but in current checkpoint, we have persisted all quota file's data, quota files are consistent with all other files in filesystem, why we can't remove thisNEED_FSCKflag..?Quoted 1 line
I said it's subtle. So, I guessed 1) set
CP_QUOTA_NEED_FSCK_FLAG, 2) clearI know it's subtle... and I agreed we can fix it like this in upstream first, but in our product, it's not rare that we hit the
QUOTA_SKIP_FLUSH(its value is 4)case, later we may encounter long latency caused by quota repairing of fsck.Quoted 2 lines
SBI_QUOTA_SKIP_FLUSHby checkpoint, 3) clearCP_QUOTA_NEED_FSCK_FLAGby another checkpoint?But later if
QUOTA_NEED_REPAIRis set, we will setQUOTA_NEED_FSCK_FLAGagain, right?if (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);So in order to figure out whether this is caused by out-of-order execution of below assignments:
if (
is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif (
is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR))
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstCould you have a try:
Quoted 7 lines
Quoted 5 lines
if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR) || is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); else __clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG);What does this mean? I'm in doubt we have a missing case where we clear this
Cpu pipeline / compiler can make code out-of-order execution, which means:
a = 1;
b = 2;may actually be executed as the order of:
b = 2;
a = 1;So I doubt that below two line codes can be executed out-of-order:
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
else
__clear_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- clear flag laterif ()
__set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); --- set flag firstIn
spin_lock_irqsave()?Not sure in coverage of
spin_lock, system can guarantee codes being executed orderly.Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
flag,
CP_QUOTA_NEED_FSCK_FLAG.Agreed, I've checked each operation in
f2fs_quota_operationsyesterday, and didn't find any missing places yet...
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Oh, I mean the place where set
SBI_QUOTA_NEED_REPAIR, I also doubt we missed to set the flag.So, I may need to keep this patch untill we find the missing case. I'll keep an eye on this.
Agreed, do you mind adding one line comment there to notice that?
/*
* TODO: we count on fsck.f2fs to clear this flag until we figure out
* missing cases which clear it incorrectly.
*/
I added like this.
Thanks,
Quoted 41 lines
Thanks,
Quoted 38 lines
Quoted 35 lines
Thanks,
Quoted 31 lines
Thanks,
Quoted 9 lines
Quoted 9 lines
Thanks,
Quoted 5 lines
Quoted 5 lines
Thanks,
Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
fs/f2fs/checkpoint.c
Quoted 3 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );.
.
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel.
.
Chao Yu
Reviewed-byQuoted 6 lines · Jaegeuk Kim
/*
* TODO: we count on fsck.f2fs to clear this flag until we figure out
* missing cases which clear it incorrectly.
*/I added like this.
Thanks,
Quoted 2 lines
Thanks,
Quoted 13 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0
fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 5 lines
fs/f2fs/checkpoint.c +0
-2@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );
Jaegeuk,
Will below commit fix this issue? Not sure, but just want to check that.. :)
f2fs-tools: fix to check total valid block count before block allocation
Thanks,
Quoted 4 lines
fs/f2fs/checkpoint.c +0
-0if (is_sbi_flag_set (sbi,SBI_QUOTA_NEED_REPAIR ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );
Jaegeuk Kim
maintainerQuoted 22 lines · Chao Yu
Quoted 13 lines · Jaegeuk Kim
If we met this once, let fsck.f2fs clear this only. Note that, this addresses all the subtle fault injection test.
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/checkpoint.c | 2 -- 1 file changed, 2 deletions(-)fs/f2fs/checkpoint.c +0
-0fs/f2fs/checkpoint.c static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) · line 1271
Quoted 5 lines
fs/f2fs/checkpoint.c +0
-2@@ -1267,8 +1267,6 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)if (is_sbi_flag_set (sbi,SBI_QUOTA_SKIP_FLUSH ))__set_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG ); -else -__clear_ckpt_flags (ckpt,CP_QUOTA_NEED_FSCK_FLAG );Jaegeuk,
Quoted 3 lines
Will below commit fix this issue? Not sure, but just want to check that.. :)
f2fs-tools: fix to check total valid block count before block allocation
I started test again whether we can revert this or not. :) Let's see.