Bug 89861

Summary: ecryptfs/BTRFS kernel BUG when kate saves text file
Product: File System Reporter: Swâmi Petaramesh (swami)
Component: btrfsAssignee: Josef Bacik (josef)
Status: RESOLVED OBSOLETE    
Severity: high CC: dsterba
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 3.12 to 3.17 Subsystem:
Regression: No Bisected commit-id:

Description Swâmi Petaramesh 2014-12-17 10:08:43 UTC
Hello,

I'm reporting a bug that I've been encoutering _very_ frequently for more than a year on several different machines (at least 4) using different distros (Ubuntu 13.10, 14.04, 14.10 ; Mint 21, Fedora FC20 & FC21 ; Arch Linux) with kernels from at least 3.12 to 3.17.

This bug is well reproductible and causes a kernel BUG in fs/namei.c when saving a text file ONLY with KDE's "kate" or "kwrite" editors.

Reproduction : Take notes during a meeting using kate in KDE, in the configuration reported below. Save file every couple of minutes. You'll get kate to freeze and kernel to BUG before the meeting ends.

The bug ALWAYS cause the file to be actually "properly saved", but kate or kwrite (and dolphin as well) completely frozen, needing a machine reboot to get things properly on their feet again.

All machines on which this occurred, besides hardware, distro and kernel versions, have the exact same setup :

- an ecryptfs encrypted filesystem ;
- over BTRFS ;
- over a LUKS-encrypted LVM.

(Please don't ask. There's a reason ;-)

All machines have an SSD (different brands, models, sizes...), but I'm not sure whether this is relevant or not.

I report this bug both to KDE, ecryptfs, BTRFS / kernel teams.

For sure ecryptfs has to do with this, but WHY does this happen *only* when saving text files in kate/kwrite ? Maybe the underlying BTRFS has something to do with this as well ?

TIA for any help. / Best regards.


Here are kernel BUG records for 2 machines :

** ASUS machine running Arch Linux:

déc. 10 06:58:18 zafu kernel: ------------[ cut here ]------------
déc. 10 06:58:18 zafu kernel: kernel BUG at fs/namei.c:2430!
déc. 10 06:58:18 zafu kernel: invalid opcode: 0000 [#1] PREEMPT SMP 
déc. 10 06:58:18 zafu kernel: Modules linked in: nls_iso8859_1 uas usb_storage fuse md5 ecryptfs encrypted_keys sha1_ssse3 sha1_generic hmac trusted ctr ccm uvcvideo videobuf2_vmalloc videobuf
déc. 10 06:58:18 zafu kernel:  soundcore shpchp sch_fq_codel vboxdrv(O) sha256_ssse3 sha256_generic ecb cbc algif_skcipher af_alg hid_multitouch hid_generic usbhid hid dm_crypt dm_mod btrfs xo
déc. 10 06:58:18 zafu kernel: CPU: 1 PID: 5003 Comm: kate Tainted: G           O   3.17.4-1-ARCH #1
déc. 10 06:58:18 zafu kernel: Hardware name: ASUSTeK COMPUTER INC. X202EV/X202EV, BIOS X202EV.200 02/27/2013
déc. 10 06:58:18 zafu kernel: task: ffff880017df0000 ti: ffff880040ee4000 task.ti: ffff880040ee4000
déc. 10 06:58:18 zafu kernel: RIP: 0010:[<ffffffff811d6e68>]  [<ffffffff811d6e68>] may_delete+0x138/0x150
déc. 10 06:58:18 zafu kernel: RSP: 0018:ffff880040ee7d78  EFLAGS: 00010206
déc. 10 06:58:18 zafu kernel: RAX: ffff88006dc4bcc0 RBX: ffff880028066840 RCX: 0000003eff0c5454
déc. 10 06:58:18 zafu kernel: RDX: 0000000000000000 RSI: ffff880028066840 RDI: ffff88009fa32430
déc. 10 06:58:18 zafu kernel: RBP: ffff880040ee7d98 R08: 0000007077732d65 R09: ffff88003b881840
déc. 10 06:58:18 zafu kernel: R10: 8080808080808080 R11: fefefefefefefeff R12: ffff8800a0846058
déc. 10 06:58:18 zafu kernel: R13: ffff88001edac198 R14: ffff880028066840 R15: ffff88009fa32430
déc. 10 06:58:18 zafu kernel: FS:  00007fa0f3058780(0000) GS:ffff88011ef00000(0000) knlGS:0000000000000000
déc. 10 06:58:18 zafu kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
déc. 10 06:58:18 zafu kernel: CR2: 00007f0cbecf1000 CR3: 0000000005d37000 CR4: 00000000001407e0
déc. 10 06:58:18 zafu kernel: Stack:
déc. 10 06:58:18 zafu kernel:  ffff880028066840 ffff88009fa32430 ffff88001edac198 ffff880028066840
déc. 10 06:58:18 zafu kernel:  ffff880040ee7dd8 ffffffff811d71cb 0000000000000000 ffff880028066840
déc. 10 06:58:18 zafu kernel:  ffff88006dc4bcc0 ffff880002c54800 ffff880091274000 ffff88009fa32430
déc. 10 06:58:18 zafu kernel: Call Trace:
déc. 10 06:58:18 zafu kernel:  [<ffffffff811d71cb>] vfs_unlink+0x2b/0x160
déc. 10 06:58:18 zafu kernel:  [<ffffffffa08e8ed5>] ecryptfs_do_unlink+0x65/0x120 [ecryptfs]
déc. 10 06:58:18 zafu kernel:  [<ffffffffa08e8fa2>] ecryptfs_unlink+0x12/0x20 [ecryptfs]
déc. 10 06:58:18 zafu kernel:  [<ffffffff811d7286>] vfs_unlink+0xe6/0x160
déc. 10 06:58:18 zafu kernel:  [<ffffffff811d7599>] do_unlinkat+0x299/0x300
déc. 10 06:58:18 zafu kernel:  [<ffffffff811c976e>] ? ____fput+0xe/0x10
déc. 10 06:58:18 zafu kernel:  [<ffffffff8108c8f4>] ? task_work_run+0xa4/0xe0
déc. 10 06:58:18 zafu kernel:  [<ffffffff81014e65>] ? do_notify_resume+0x95/0xa0
déc. 10 06:58:18 zafu kernel:  [<ffffffff811d85a6>] SyS_unlink+0x16/0x20
déc. 10 06:58:18 zafu kernel:  [<ffffffff8153db29>] system_call_fastpath+0x16/0x1b
déc. 10 06:58:18 zafu kernel: Code: 00 00 00 48 39 5b 18 75 d5 b8 f0 ff ff ff eb aa 0f 1f 00 b8 ff ff ff ff eb a0 66 0f 1f 84 00 00 00 00 00 0f 0b 66 0f 1f 44 00 00 <0f> 0b 66 0f 1f 44 00 00 b
déc. 10 06:58:18 zafu kernel: RIP  [<ffffffff811d6e68>] may_delete+0x138/0x150
déc. 10 06:58:18 zafu kernel:  RSP <ffff880040ee7d78>
déc. 10 06:58:18 zafu kernel: ---[ end trace a98dddb4e9edd080 ]--- 


** HP machine running Fedora FC21:

déc. 17 10:09:42 vajra kernel: ------------[ cut here ]------------
déc. 17 10:09:42 vajra kernel: kernel BUG at fs/namei.c:2430!
déc. 17 10:09:42 vajra kernel: invalid opcode: 0000 [#1] SMP 
déc. 17 10:09:42 vajra kernel: Modules linked in: uas usb_storage rfcomm ccm ip6t_rpfilter ip6t_REJECT xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip
déc. 17 10:09:42 vajra kernel:  snd_hda_codec snd_hwdep wmi snd_seq snd_seq_device parport_pc parport snd_pcm hp_accel lpc_ich mei_me lis3lv02d mei input_polldev snd_timer i2c_i801 snd
déc. 17 10:09:42 vajra kernel: CPU: 3 PID: 2098 Comm: kate Tainted: G           OE  3.17.6-300.fc21.x86_64 #1
déc. 17 10:09:42 vajra kernel: Hardware name: Hewlett-Packard HP EliteBook 820 G1/1991, BIOS L71 Ver. 01.12 06/25/2014
déc. 17 10:09:42 vajra kernel: task: ffff8800ac7a13a0 ti: ffff8800a0df4000 task.ti: ffff8800a0df4000
déc. 17 10:09:42 vajra kernel: RIP: 0010:[<ffffffff8121aac0>]  [<ffffffff8121aac0>] may_delete+0x180/0x1a0
déc. 17 10:09:42 vajra kernel: RSP: 0018:ffff8800a0df7d78  EFLAGS: 00010283
déc. 17 10:09:42 vajra kernel: RAX: ffff8800a0098d80 RBX: ffff8801863fec00 RCX: 00000011001c001c
déc. 17 10:09:42 vajra kernel: RDX: 0000000000000000 RSI: ffff8801863fec00 RDI: ffff8801e0a6fd98
déc. 17 10:09:42 vajra kernel: RBP: ffff8800a0df7d98 R08: 0000000000000000 R09: 0000000000000000
déc. 17 10:09:42 vajra kernel: R10: 0000000000000000 R11: ffff8801863fef00 R12: ffff8801e0a018d8
déc. 17 10:09:42 vajra kernel: R13: ffff880173c87d98 R14: ffff880173c87d98 R15: ffff8801e0a6fd98
déc. 17 10:09:42 vajra kernel: FS:  00007f15f1ca1880(0000) GS:ffff88023eac0000(0000) knlGS:0000000000000000
déc. 17 10:09:42 vajra kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
déc. 17 10:09:42 vajra kernel: CR2: 00007f7d80d99008 CR3: 00000000a6d1b000 CR4: 00000000001407e0
déc. 17 10:09:42 vajra kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
déc. 17 10:09:42 vajra kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
déc. 17 10:09:42 vajra kernel: Stack:
déc. 17 10:09:42 vajra kernel:  ffff8801863fec00 ffff8801e0a6fd98 ffff880173c87d98 ffff8801863fec00
déc. 17 10:09:42 vajra kernel:  ffff8800a0df7dd8 ffffffff8121ae0b 0000000000000000 ffff8801863fec00
déc. 17 10:09:42 vajra kernel:  ffff8800a0098d80 ffff88021b4e5800 ffff88019aa89c00 ffff8801e0a6fd98
déc. 17 10:09:42 vajra kernel: Call Trace:
déc. 17 10:09:42 vajra kernel:  [<ffffffff8121ae0b>] vfs_unlink+0x2b/0x160
déc. 17 10:09:42 vajra kernel:  [<ffffffffa0022ed5>] ecryptfs_do_unlink+0x65/0x120 [ecryptfs]
déc. 17 10:09:42 vajra kernel:  [<ffffffffa0022fa2>] ecryptfs_unlink+0x12/0x20 [ecryptfs]
déc. 17 10:09:42 vajra kernel:  [<ffffffff8121aec6>] vfs_unlink+0xe6/0x160
déc. 17 10:09:42 vajra kernel:  [<ffffffff8121b1be>] do_unlinkat+0x27e/0x2f0
déc. 17 10:09:42 vajra kernel:  [<ffffffff8120e3ae>] ? ____fput+0xe/0x10
déc. 17 10:09:42 vajra kernel:  [<ffffffff810b395c>] ? task_work_run+0xbc/0xf0
déc. 17 10:09:42 vajra kernel:  [<ffffffff81013e37>] ? do_notify_resume+0x97/0xb0
déc. 17 10:09:42 vajra kernel:  [<ffffffff8121ea96>] SyS_unlink+0x16/0x20
déc. 17 10:09:42 vajra kernel:  [<ffffffff81746a69>] system_call_fastpath+0x16/0x1b
déc. 17 10:09:42 vajra kernel: Code: eb ac 66 0f 1f 84 00 00 00 00 00 0f 0b 66 0f 1f 44 00 00 48 39 5b 18 0f 85 7a ff ff ff b8 f0 ff ff ff eb 8a 0f 1f 80 00 00 00 00 <0f> 0b 66 0f 1f 4
déc. 17 10:09:42 vajra kernel: RIP  [<ffffffff8121aac0>] may_delete+0x180/0x1a0
déc. 17 10:09:42 vajra kernel:  RSP <ffff8800a0df7d78>
déc. 17 10:09:42 vajra kernel: ---[ end trace 66c1a392fd396bb8 ]---
Comment 1 Swâmi Petaramesh 2014-12-17 10:14:45 UTC
Also reported here:
https://bugs.launchpad.net/bugs/1403429
https://bugs.kde.org/show_bug.cgi?id=341967
Comment 2 David Sterba 2022-10-04 08:17:30 UTC
This is a semi-automated bugzilla cleanup, report is against an old kernel version. If the problem still happens, please open a new bug. Thanks.