All of lore.kernel.org
 help / color / mirror / Atom feed
* f2fs: WARNING: at fs/f2fs/segment.c:718 update_sit_entry+0x1c0/0x2b0()
@ 2017-08-23 12:21 Stijn Tintel
  2017-08-23 20:37 ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Stijn Tintel @ 2017-08-23 12:21 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim

Hi,

Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools
("mkfs.f2fs: give random checkpoint version") causes a bug when mounting
a filesystem created with it on a MIPS64 device running a 4.4(.83)
kernel. The following kernel warning appears several times per second,
for 30 seconds:

[   23.837262] ------------[ cut here ]------------
[   23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718
update_sit_entry+0x1c0/0x2b0()
[   23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat
pptp pppox ppp_mppe ppp_generic nft_chain_nat_ipv4 nf_tables_inet
nf_nat_pptp nf_nat_ipv6 nf_nat_ipv4 nf_nat_amanda nf_conntrack_pptp
nf_conntrack_ipv6 nf_conntrack_ipv4 nf_conntrack_amanda ipt_REJECT
ipt_MASQUERADE xt_time xt_tcpudp xt_tcpmss xt_string xt_statistic
xt_state xt_recent xt_quota xt_policy xt_pkttype xt_physdev xt_owner
xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper
xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes
xt_comment xt_addrtype xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_DSCP
xt_CLASSIFY wireguard ts_kmp ts_fsm ts_bm slhc nft_reject_ipv6
nft_reject_ipv4 nft_reject_inet nft_reject nft_redir_ipv4 nft_redir
nft_rbtree nft_nat nft_meta nft_masq_ipv6 nft_masq_ipv4 nft_masq nft_log
nft_limit nft_hash nft_exthdr nft_ct nft_counter nft_chain_route_ipv6
nft_chain_route_ipv4 nf_tables_ipv6 nf_tables_ipv4 nf_tables
nf_reject_ipv4 nf_nat_tftp nf_nat_snmp_basic nf_nat_sip nf_nat_rtsp
nf_nat_redirect nf_nat_proto_gre nf_nat_masquerade_ipv6
nf_nat_masquerade_ipv4 nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat
nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_tftp
nf_conntrack_snmp nf_conntrack_sip nf_conntrack_rtsp
nf_conntrack_rtcache nf_conntrack_proto_gre nf_conntrack_netlink
nf_conntrack_irc nf_conntrack_h323 nf_conntrack_ftp
nf_conntrack_broadcast macvlan iptable_mangle iptable_filter ipt_ah
ipt_ECN ip_tables crc_ccitt compat_xtables br_netfilter sch_cake
sch_teql em_nbyte sch_codel sch_prio sch_pie act_ipt sch_gred sch_dsmark
cls_basic em_cmp em_text em_meta sch_sfq act_police sch_fq sch_red
act_connmark nf_conntrack act_skbedit act_mirred em_u32 cls_u32
cls_tcindex cls_flow cls_route cls_fw sch_tbf sch_htb sch_hfsc
sch_ingress cryptodev xt_set ip_set_list_set ip_set_hash_netiface
ip_set_hash_netport ip_set_hash_netnet ip_set_hash_net
ip_set_hash_netportnet ip_set_hash_mac ip_set_hash_ipportnet
ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark
ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip
ip_set nfnetlink ip6t_rt ip6t_frag ip6t_hbh ip6t_eui64 ip6t_mh ip6t_ah
ip6t_ipv6header ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
ip6table_mangle ip6table_filter ip6_tables x_tables ip_gre gre ifb
l2tp_ip6 l2tp_ip l2tp_eth ip6_vti ip_vti sit l2tp_netlink l2tp_core
udp_tunnel ip6_udp_tunnel ipcomp6 xfrm6_tunnel xfrm6_mode_tunnel
xfrm6_mode_transport xfrm6_mode_beet esp6 ah6 ipcomp xfrm4_tunnel
xfrm4_mode_tunnel xfrm4_mode_transport xfrm4_mode_beet esp4 ah4
ip6_tunnel tunnel6 tunnel4 ip_tunnel af_key xfrm_user xfrm_ipcomp
xfrm_algo octeon_sha512 sha512_generic octeon_sha256 sha256_generic
octeon_sha1 sha1_generic seqiv jitterentropy_rng drbg octeon_md5 md5
hmac ghash_generic gf128mul gcm echainiv ecb des_generic deflate
zlib_deflate ctr ccm cbc authenc
[   24.102820] CPU: 0 PID: 935 Comm: uci Not tainted 4.4.83 #0
[   24.108394] Stack : ffffffff81670000 ffffffff8117590c
ffffffff81810000 0000000000000001
          ffffffff81810000 0000000000000000 00000000000000ce
0000000000000006
          ffffffff815bae90 ffffffff81810000 0000000000000000
ffffffff817eaf5a
          0000000000000006 0000000000000004 0000000000000000
000000000000002f
          0000000000000000 800000000f113708 0000000000000000
ffffffff81175de4
          0000000000000000 0000000000000000 ffffffff81670000
ffffffff81670000
          ffffffff81660000 ffffffff815b5778 800000041f9d8000
0000000000000000
          00000000000003a7 ffffffff817e6df8 800000000f1135d0
0000000000000080
          ffffffff81321fc4 0000000000000000 800000000f113708
dc8fa200cb8c572c
          ffffffff8166c55f ffffffff81176bac ffffffff81126e14
ffffffff815b5778
          ...
[   24.174064] Call Trace:
[   24.176527] [<ffffffff81126e14>] show_stack+0x68/0xb4
[   24.181595] [<ffffffff81321fc4>] dump_stack+0x8c/0xc4
[   24.186660] [<ffffffff8113d004>] warn_slowpath_common+0xa0/0xd0
[   24.192597] [<ffffffff812e0148>] update_sit_entry+0x1c0/0x2b0
[   24.198353] [<ffffffff812e0a70>] refresh_sit_entry+0x70/0xf8
[   24.204022] [<ffffffff812e251c>] allocate_data_block+0x1f0/0x310
[   24.210038] [<ffffffff812e28d8>] do_write_page+0x29c/0x2bc
[   24.215532] [<ffffffff812e2a88>] write_data_page+0xa0/0xd8
[   24.221028] [<ffffffff812d844c>] do_write_data_page+0xe4/0x384
[   24.226870] [<ffffffff812d88f4>] f2fs_write_data_page+0x208/0x464
[   24.232972] [<ffffffff812d5184>] __f2fs_writepage+0x1c/0x74
[   24.238553] [<ffffffff812d54dc>]
f2fs_write_cache_pages.constprop.7+0x250/0x394
[   24.245869] [<ffffffff812d57f4>] f2fs_write_data_pages+0x130/0x1b0
[   24.252066] [<ffffffff811a9f80>] __filemap_fdatawrite_range+0xa0/0xd4
[   24.258515] [<ffffffff812d2338>] sync_dirty_dir_inodes+0x94/0xd8
[   24.264530] [<ffffffff812d2484>] write_checkpoint+0x108/0xb9c
[   24.270283] [<ffffffff812cc398>] f2fs_sync_fs+0x68/0xb0
[   24.275526] [<ffffffff812c641c>] f2fs_sync_file+0x2e8/0x518
[   24.281107] [<ffffffff81213ff4>] do_fsync+0x38/0x70
[   24.285992] [<ffffffff812142e8>] SyS_fsync+0x14/0x20
[   24.290972] [<ffffffff81103950>] syscall_common+0x34/0x58
[   24.296372]
[   24.298096] ---[ end trace fd3ac44449b218ab ]---

It then stops for a minute, and starts re-appearing for at least a
minute, before it settles down and only appears sporadically.

This problem was reported downstream at
https://bugs.lede-project.org/index.php?do=details&task_id=749. It does
not occur on a 4.9(.44) kernel, and it also does not occur on an x86/64
device running 4.4(.83).

Kind regards,
Stijn


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

* Re: f2fs: WARNING: at fs/f2fs/segment.c:718 update_sit_entry+0x1c0/0x2b0()
  2017-08-23 12:21 f2fs: WARNING: at fs/f2fs/segment.c:718 update_sit_entry+0x1c0/0x2b0() Stijn Tintel
@ 2017-08-23 20:37 ` Jaegeuk Kim
  2017-08-24  7:02   ` Stijn Tintel
  0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2017-08-23 20:37 UTC (permalink / raw)
  To: Stijn Tintel; +Cc: linux-f2fs-devel

Thank you for the report.
Could you please test this patch?

>From 440e8638c5b4a7e7bd1234ea1e7da20ce226112e Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Wed, 23 Aug 2017 13:33:00 -0700
Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version

The error on mips was reported by Stjin as follow.

Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools
("mkfs.f2fs: give random checkpoint version") causes a bug when mounting
a filesystem created with it on a MIPS64 device running a 4.4(.83)
kernel. The following kernel warning appears several times per second,
for 30 seconds:

[   23.837262] ------------[ cut here ]------------
[   23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718
update_sit_entry+0x1c0/0x2b0()
[   23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat
[   24.174064] Call Trace:
[   24.176527] [<ffffffff81126e14>] show_stack+0x68/0xb4
[   24.181595] [<ffffffff81321fc4>] dump_stack+0x8c/0xc4
[   24.186660] [<ffffffff8113d004>] warn_slowpath_common+0xa0/0xd0
[   24.192597] [<ffffffff812e0148>] update_sit_entry+0x1c0/0x2b0
[   24.198353] [<ffffffff812e0a70>] refresh_sit_entry+0x70/0xf8
[   24.204022] [<ffffffff812e251c>] allocate_data_block+0x1f0/0x310
[   24.210038] [<ffffffff812e28d8>] do_write_page+0x29c/0x2bc
[   24.215532] [<ffffffff812e2a88>] write_data_page+0xa0/0xd8
[   24.221028] [<ffffffff812d844c>] do_write_data_page+0xe4/0x384
[   24.226870] [<ffffffff812d88f4>] f2fs_write_data_page+0x208/0x464
[   24.232972] [<ffffffff812d5184>] __f2fs_writepage+0x1c/0x74
[   24.238553] [<ffffffff812d54dc>]
f2fs_write_cache_pages.constprop.7+0x250/0x394
[   24.245869] [<ffffffff812d57f4>] f2fs_write_data_pages+0x130/0x1b0
[   24.252066] [<ffffffff811a9f80>] __filemap_fdatawrite_range+0xa0/0xd4
[   24.258515] [<ffffffff812d2338>] sync_dirty_dir_inodes+0x94/0xd8
[   24.264530] [<ffffffff812d2484>] write_checkpoint+0x108/0xb9c
[   24.270283] [<ffffffff812cc398>] f2fs_sync_fs+0x68/0xb0
[   24.275526] [<ffffffff812c641c>] f2fs_sync_file+0x2e8/0x518
[   24.281107] [<ffffffff81213ff4>] do_fsync+0x38/0x70
[   24.285992] [<ffffffff812142e8>] SyS_fsync+0x14/0x20
[   24.290972] [<ffffffff81103950>] syscall_common+0x34/0x58
[   24.296372]
[   24.298096] ---[ end trace fd3ac44449b218ab ]---

Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version")
Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 mkfs/f2fs_format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 92876b8..b379e80 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void)
 	}
 
 	/* 1. cp page 1 of checkpoint pack 1 */
-	cp->checkpoint_ver = rand() | 0x1;
+	cp->checkpoint_ver = cpu_to_le64(rand() | 0x1);
 	set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]);
 	set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]);
 	set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]);
-- 
2.14.0.rc1.383.gd1ce394fe2-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: f2fs: WARNING: at fs/f2fs/segment.c:718 update_sit_entry+0x1c0/0x2b0()
  2017-08-23 20:37 ` Jaegeuk Kim
@ 2017-08-24  7:02   ` Stijn Tintel
  2017-08-24 19:02     ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Stijn Tintel @ 2017-08-24  7:02 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel

On 23-08-17 23:37, Jaegeuk Kim wrote:
> Thank you for the report.
> Could you please test this patch?
That seems to fix it, thanks!
>
> From 440e8638c5b4a7e7bd1234ea1e7da20ce226112e Mon Sep 17 00:00:00 2001
> From: Jaegeuk Kim <jaegeuk@kernel.org>
> Date: Wed, 23 Aug 2017 13:33:00 -0700
> Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version
>
> The error on mips was reported by Stjin as follow.
Minor nit about a typo ;-)
>
> Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools
> ("mkfs.f2fs: give random checkpoint version") causes a bug when mounting
> a filesystem created with it on a MIPS64 device running a 4.4(.83)
> kernel. The following kernel warning appears several times per second,
> for 30 seconds:
>
> [   23.837262] ------------[ cut here ]------------
> [   23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718
> update_sit_entry+0x1c0/0x2b0()
> [   23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat
> [   24.174064] Call Trace:
> [   24.176527] [<ffffffff81126e14>] show_stack+0x68/0xb4
> [   24.181595] [<ffffffff81321fc4>] dump_stack+0x8c/0xc4
> [   24.186660] [<ffffffff8113d004>] warn_slowpath_common+0xa0/0xd0
> [   24.192597] [<ffffffff812e0148>] update_sit_entry+0x1c0/0x2b0
> [   24.198353] [<ffffffff812e0a70>] refresh_sit_entry+0x70/0xf8
> [   24.204022] [<ffffffff812e251c>] allocate_data_block+0x1f0/0x310
> [   24.210038] [<ffffffff812e28d8>] do_write_page+0x29c/0x2bc
> [   24.215532] [<ffffffff812e2a88>] write_data_page+0xa0/0xd8
> [   24.221028] [<ffffffff812d844c>] do_write_data_page+0xe4/0x384
> [   24.226870] [<ffffffff812d88f4>] f2fs_write_data_page+0x208/0x464
> [   24.232972] [<ffffffff812d5184>] __f2fs_writepage+0x1c/0x74
> [   24.238553] [<ffffffff812d54dc>]
> f2fs_write_cache_pages.constprop.7+0x250/0x394
> [   24.245869] [<ffffffff812d57f4>] f2fs_write_data_pages+0x130/0x1b0
> [   24.252066] [<ffffffff811a9f80>] __filemap_fdatawrite_range+0xa0/0xd4
> [   24.258515] [<ffffffff812d2338>] sync_dirty_dir_inodes+0x94/0xd8
> [   24.264530] [<ffffffff812d2484>] write_checkpoint+0x108/0xb9c
> [   24.270283] [<ffffffff812cc398>] f2fs_sync_fs+0x68/0xb0
> [   24.275526] [<ffffffff812c641c>] f2fs_sync_file+0x2e8/0x518
> [   24.281107] [<ffffffff81213ff4>] do_fsync+0x38/0x70
> [   24.285992] [<ffffffff812142e8>] SyS_fsync+0x14/0x20
> [   24.290972] [<ffffffff81103950>] syscall_common+0x34/0x58
> [   24.296372]
> [   24.298096] ---[ end trace fd3ac44449b218ab ]---
>
> Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version")
> Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
> ---
>  mkfs/f2fs_format.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index 92876b8..b379e80 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void)
>  	}
>  
>  	/* 1. cp page 1 of checkpoint pack 1 */
> -	cp->checkpoint_ver = rand() | 0x1;
> +	cp->checkpoint_ver = cpu_to_le64(rand() | 0x1);
>  	set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]);
>  	set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]);
>  	set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]);



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: f2fs: WARNING: at fs/f2fs/segment.c:718 update_sit_entry+0x1c0/0x2b0()
  2017-08-24  7:02   ` Stijn Tintel
@ 2017-08-24 19:02     ` Jaegeuk Kim
  2017-08-28  9:21       ` Chao Yu
  0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2017-08-24 19:02 UTC (permalink / raw)
  To: Stijn Tintel; +Cc: linux-f2fs-devel

On 08/24, Stijn Tintel wrote:
> On 23-08-17 23:37, Jaegeuk Kim wrote:
> > Thank you for the report.
> > Could you please test this patch?
> That seems to fix it, thanks!
> >
> > From 440e8638c5b4a7e7bd1234ea1e7da20ce226112e Mon Sep 17 00:00:00 2001
> > From: Jaegeuk Kim <jaegeuk@kernel.org>
> > Date: Wed, 23 Aug 2017 13:33:00 -0700
> > Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version
> >
> > The error on mips was reported by Stjin as follow.
> Minor nit about a typo ;-)

Oh, sorry. Merged with fix. Thank you~

> >
> > Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools
> > ("mkfs.f2fs: give random checkpoint version") causes a bug when mounting
> > a filesystem created with it on a MIPS64 device running a 4.4(.83)
> > kernel. The following kernel warning appears several times per second,
> > for 30 seconds:
> >
> > [   23.837262] ------------[ cut here ]------------
> > [   23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718
> > update_sit_entry+0x1c0/0x2b0()
> > [   23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat
> > [   24.174064] Call Trace:
> > [   24.176527] [<ffffffff81126e14>] show_stack+0x68/0xb4
> > [   24.181595] [<ffffffff81321fc4>] dump_stack+0x8c/0xc4
> > [   24.186660] [<ffffffff8113d004>] warn_slowpath_common+0xa0/0xd0
> > [   24.192597] [<ffffffff812e0148>] update_sit_entry+0x1c0/0x2b0
> > [   24.198353] [<ffffffff812e0a70>] refresh_sit_entry+0x70/0xf8
> > [   24.204022] [<ffffffff812e251c>] allocate_data_block+0x1f0/0x310
> > [   24.210038] [<ffffffff812e28d8>] do_write_page+0x29c/0x2bc
> > [   24.215532] [<ffffffff812e2a88>] write_data_page+0xa0/0xd8
> > [   24.221028] [<ffffffff812d844c>] do_write_data_page+0xe4/0x384
> > [   24.226870] [<ffffffff812d88f4>] f2fs_write_data_page+0x208/0x464
> > [   24.232972] [<ffffffff812d5184>] __f2fs_writepage+0x1c/0x74
> > [   24.238553] [<ffffffff812d54dc>]
> > f2fs_write_cache_pages.constprop.7+0x250/0x394
> > [   24.245869] [<ffffffff812d57f4>] f2fs_write_data_pages+0x130/0x1b0
> > [   24.252066] [<ffffffff811a9f80>] __filemap_fdatawrite_range+0xa0/0xd4
> > [   24.258515] [<ffffffff812d2338>] sync_dirty_dir_inodes+0x94/0xd8
> > [   24.264530] [<ffffffff812d2484>] write_checkpoint+0x108/0xb9c
> > [   24.270283] [<ffffffff812cc398>] f2fs_sync_fs+0x68/0xb0
> > [   24.275526] [<ffffffff812c641c>] f2fs_sync_file+0x2e8/0x518
> > [   24.281107] [<ffffffff81213ff4>] do_fsync+0x38/0x70
> > [   24.285992] [<ffffffff812142e8>] SyS_fsync+0x14/0x20
> > [   24.290972] [<ffffffff81103950>] syscall_common+0x34/0x58
> > [   24.296372]
> > [   24.298096] ---[ end trace fd3ac44449b218ab ]---
> >
> > Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version")
> > Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
> > ---
> >  mkfs/f2fs_format.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> > index 92876b8..b379e80 100644
> > --- a/mkfs/f2fs_format.c
> > +++ b/mkfs/f2fs_format.c
> > @@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void)
> >  	}
> >  
> >  	/* 1. cp page 1 of checkpoint pack 1 */
> > -	cp->checkpoint_ver = rand() | 0x1;
> > +	cp->checkpoint_ver = cpu_to_le64(rand() | 0x1);
> >  	set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]);
> >  	set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]);
> >  	set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]);
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: f2fs: WARNING: at fs/f2fs/segment.c:718 update_sit_entry+0x1c0/0x2b0()
  2017-08-24 19:02     ` Jaegeuk Kim
@ 2017-08-28  9:21       ` Chao Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2017-08-28  9:21 UTC (permalink / raw)
  To: Jaegeuk Kim, Stijn Tintel; +Cc: linux-f2fs-devel

On 2017/8/25 3:02, Jaegeuk Kim wrote:
> On 08/24, Stijn Tintel wrote:
>> On 23-08-17 23:37, Jaegeuk Kim wrote:
>>> Thank you for the report.
>>> Could you please test this patch?
>> That seems to fix it, thanks!
>>>
>>> From 440e8638c5b4a7e7bd1234ea1e7da20ce226112e Mon Sep 17 00:00:00 2001
>>> From: Jaegeuk Kim <jaegeuk@kernel.org>
>>> Date: Wed, 23 Aug 2017 13:33:00 -0700
>>> Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version
>>>
>>> The error on mips was reported by Stjin as follow.
>> Minor nit about a typo ;-)
> 
> Oh, sorry. Merged with fix. Thank you~
> 
>>>
>>> Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools
>>> ("mkfs.f2fs: give random checkpoint version") causes a bug when mounting
>>> a filesystem created with it on a MIPS64 device running a 4.4(.83)
>>> kernel. The following kernel warning appears several times per second,
>>> for 30 seconds:
>>>
>>> [   23.837262] ------------[ cut here ]------------
>>> [   23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718
>>> update_sit_entry+0x1c0/0x2b0()
>>> [   23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat
>>> [   24.174064] Call Trace:
>>> [   24.176527] [<ffffffff81126e14>] show_stack+0x68/0xb4
>>> [   24.181595] [<ffffffff81321fc4>] dump_stack+0x8c/0xc4
>>> [   24.186660] [<ffffffff8113d004>] warn_slowpath_common+0xa0/0xd0
>>> [   24.192597] [<ffffffff812e0148>] update_sit_entry+0x1c0/0x2b0
>>> [   24.198353] [<ffffffff812e0a70>] refresh_sit_entry+0x70/0xf8
>>> [   24.204022] [<ffffffff812e251c>] allocate_data_block+0x1f0/0x310
>>> [   24.210038] [<ffffffff812e28d8>] do_write_page+0x29c/0x2bc
>>> [   24.215532] [<ffffffff812e2a88>] write_data_page+0xa0/0xd8
>>> [   24.221028] [<ffffffff812d844c>] do_write_data_page+0xe4/0x384
>>> [   24.226870] [<ffffffff812d88f4>] f2fs_write_data_page+0x208/0x464
>>> [   24.232972] [<ffffffff812d5184>] __f2fs_writepage+0x1c/0x74
>>> [   24.238553] [<ffffffff812d54dc>]
>>> f2fs_write_cache_pages.constprop.7+0x250/0x394
>>> [   24.245869] [<ffffffff812d57f4>] f2fs_write_data_pages+0x130/0x1b0
>>> [   24.252066] [<ffffffff811a9f80>] __filemap_fdatawrite_range+0xa0/0xd4
>>> [   24.258515] [<ffffffff812d2338>] sync_dirty_dir_inodes+0x94/0xd8
>>> [   24.264530] [<ffffffff812d2484>] write_checkpoint+0x108/0xb9c
>>> [   24.270283] [<ffffffff812cc398>] f2fs_sync_fs+0x68/0xb0
>>> [   24.275526] [<ffffffff812c641c>] f2fs_sync_file+0x2e8/0x518
>>> [   24.281107] [<ffffffff81213ff4>] do_fsync+0x38/0x70
>>> [   24.285992] [<ffffffff812142e8>] SyS_fsync+0x14/0x20
>>> [   24.290972] [<ffffffff81103950>] syscall_common+0x34/0x58
>>> [   24.296372]
>>> [   24.298096] ---[ end trace fd3ac44449b218ab ]---
>>>
>>> Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version")
>>> Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>> Tested-by: Stijn Tintel <stijn@linux-ipv6.be>

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

>>> ---
>>>  mkfs/f2fs_format.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
>>> index 92876b8..b379e80 100644
>>> --- a/mkfs/f2fs_format.c
>>> +++ b/mkfs/f2fs_format.c
>>> @@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void)
>>>  	}
>>>  
>>>  	/* 1. cp page 1 of checkpoint pack 1 */
>>> -	cp->checkpoint_ver = rand() | 0x1;
>>> +	cp->checkpoint_ver = cpu_to_le64(rand() | 0x1);
>>>  	set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]);
>>>  	set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]);
>>>  	set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]);
>>
> 
> ------------------------------------------------------------------------------
> 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
> 
> .
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

end of thread, other threads:[~2017-08-28  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 12:21 f2fs: WARNING: at fs/f2fs/segment.c:718 update_sit_entry+0x1c0/0x2b0() Stijn Tintel
2017-08-23 20:37 ` Jaegeuk Kim
2017-08-24  7:02   ` Stijn Tintel
2017-08-24 19:02     ` Jaegeuk Kim
2017-08-28  9:21       ` 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.