Bug 1474000 - Attempting to delete a file on a RAID1 BTRFS volume results in the volume being mounted read only
Summary: Attempting to delete a file on a RAID1 BTRFS volume results in the volume bei...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 26
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-23 01:11 UTC by redhatbugzilla
Modified: 2018-04-09 21:59 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-09 21:59:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Output of a BTRFS Check (53.14 KB, text/plain)
2017-07-24 00:19 UTC, redhatbugzilla
no flags Details

Description redhatbugzilla 2017-07-23 01:11:05 UTC
Description of problem:
Attempting to delete a file on a RAID1 BTRFS volume results in the volume being mounted read only

Version-Release number of selected component (if applicable):
Kernel 4.11.10-300.fc26.x86_64
Also affected kernel-4.11.9-300.fc25.x86_64

How reproducible:
Everytime (for my particular setup)

Steps to Reproduce:
1. rm /export/gw/hourly.3/usr/src/kernels/4.10.8-200.fc25.x86_64/include/config/dvb/lgdt3305.h

Actual results:
rm: cannot remove '/export/gw/hourly.3/usr/src/kernels/4.10.8-200.fc25.x86_64/include/config/dvb/lgdt3305.h': No such file or directory
rm: cannot remove '/export/lgdt3305.h': No such file or directory
mount | grep btrfs                                                                         
/dev/sdb on /export type btrfs (ro,relatime,degraded,compress=lzo,space_cache,subvolid=5,subvol=/)

Expected results:
mount | grep btrfs
/dev/sdb on /export type btrfs (rw,relatime,degraded,compress=lzo,space_cache,subvolid=5,subvol=/)


Additional info:
ll /export/gw/hourly.3/usr/src/kernels/4.10.8-200.fc25.x86_64/include/config/dvb/lgdt3305.h
-rw-r--r-- 17 root root 0 Apr  1 00:42 /export/gw/hourly.3/usr/src/kernels/4.10.8-200.fc25.x86_64/include/config/dvb/lgdt3305.h

Extract from /var/log/messages - 

Jul 23 11:06:44 localhost kernel: BTRFS info (device sdc): failed to delete reference to lgdt3305.h, inode 26226819 parent 96036417
Jul 23 11:06:44 localhost kernel: ------------[ cut here ]------------
Jul 23 11:06:44 localhost kernel: WARNING: CPU: 0 PID: 986 at fs/btrfs/inode.c:3962 __btrfs_unlink_inode+0x473/0x550 [btrfs]
Jul 23 11:06:44 localhost kernel: Modules linked in: rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack libcrc32c intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm irqbypass crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi ghash_clmulni_intel btrfs intel_cstate intel_uncore iTCO_wdt snd_hda_codec_realtek intel_rapl_perf snd_hda_codec_generic mei_wdt eeepc_wmi asus_wmi mxm_wmi sparse_keymap iTCO_vendor_support snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep xor hci_uart snd_seq snd_seq_device snd_pcm raid6_pq btbcm joydev btqca intel_lpss_acpi intel_lpss btintel snd_timer snd soundcore bluetooth mei_me pinctrl_sunrisepoint shpchp pinctrl_intel mei rfkill i2c_i801 acpi_als kfifo_buf tpm_tis tpm_tis_core acpi_pad industrialio tpm wmi nfsd auth_rpcgss nfs_acl
Jul 23 11:06:44 localhost kernel: lockd grace sunrpc i915 crc32c_intel i2c_algo_bit drm_kms_helper serio_raw r8169 drm mii video i2c_hid
Jul 23 11:06:44 localhost kernel: CPU: 0 PID: 986 Comm: mv Not tainted 4.11.10-300.fc26.x86_64 #1
Jul 23 11:06:44 localhost kernel: Hardware name: System manufacturer System Product Name/B150M-K, BIOS 3016 12/27/2016
Jul 23 11:06:44 localhost kernel: Call Trace:
Jul 23 11:06:44 localhost kernel: dump_stack+0x63/0x84
Jul 23 11:06:44 localhost kernel: __warn+0xcb/0xf0
Jul 23 11:06:44 localhost kernel: warn_slowpath_fmt+0x5a/0x80
Jul 23 11:06:44 localhost kernel: __btrfs_unlink_inode+0x473/0x550 [btrfs]
Jul 23 11:06:44 localhost kernel: btrfs_rename2+0x530/0x1740 [btrfs]
Jul 23 11:06:44 localhost kernel: ? __check_object_size+0x31/0x1b3
Jul 23 11:06:44 localhost kernel: ? vfs_rename+0x11d/0x970
Jul 23 11:06:44 localhost kernel: vfs_rename+0x446/0x970
Jul 23 11:06:44 localhost kernel: ? vfs_rename+0x446/0x970
Jul 23 11:06:44 localhost kernel: ? hashlen_string+0x40/0xa0
Jul 23 11:06:44 localhost kernel: SyS_rename+0x33c/0x390
Jul 23 11:06:44 localhost kernel: entry_SYSCALL_64_fastpath+0x1a/0xa9
Jul 23 11:06:44 localhost kernel: RIP: 0033:0x7f4782ffd3e7
Jul 23 11:06:44 localhost kernel: RSP: 002b:00007fffbeba0148 EFLAGS: 00000202 ORIG_RAX: 0000000000000052
Jul 23 11:06:44 localhost kernel: RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 00007f4782ffd3e7
Jul 23 11:06:44 localhost kernel: RDX: 000055ee5939f4b0 RSI: 00007fffbeba16b3 RDI: 00007fffbeba165a
Jul 23 11:06:44 localhost kernel: RBP: 00007fffbeba16b3 R08: 0000000000000000 R09: 0000000000000000
Jul 23 11:06:44 localhost kernel: R10: 0000000000000001 R11: 0000000000000202 R12: 0000000001903083
Jul 23 11:06:44 localhost kernel: R13: 00007fffbeba16b3 R14: 0000000000000000 R15: 00007fffbeba165a
Jul 23 11:06:44 localhost kernel: ---[ end trace edb25ce420620c62 ]---
Jul 23 11:06:44 localhost kernel: BTRFS: error (device sdc) in __btrfs_unlink_inode:3962: errno=-2 No such entry
Jul 23 11:06:44 localhost kernel: BTRFS info (device sdc): forced readonly
Jul 23 11:06:44 localhost kernel: BTRFS: error (device sdc) in btrfs_rename:9852: errno=-2 No such entry
Jul 23 11:06:45 localhost abrt-dump-journal-oops: abrt-dump-journal-oops: Found oopses: 1
Jul 23 11:06:45 localhost abrt-dump-journal-oops: abrt-dump-journal-oops: Creating problem directories
Jul 23 11:06:46 localhost abrt-dump-journal-oops: Reported 1 kernel oopses to Abrt
Jul 23 11:06:46 localhost abrt-server: Deleting problem directory oops-2017-07-23-11:06:45-662-0 (dup of oops-2017-07-23-11:00:29-671-0)
Jul 23 11:06:46 localhost dbus-daemon[620]: [system] Activating service name='org.freedesktop.problems' requested by ':1.22' (uid=0 pid=995 comm="/usr/bin/python3 /usr/bin/abrt-action-notify -d /v") (using servicehelper)
Jul 23 11:06:47 localhost dbus-daemon[620]: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.23" (uid=0 pid=997 comm="/usr/sbin/abrt-dbus -t133 ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)
Jul 23 11:06:47 localhost dbus-daemon[620]: [system] Successfully activated service 'org.freedesktop.problems'
Jul 23 11:06:47 localhost abrt-notification: System encountered a non-fatal error in __warn()



mount /export and /var/log/messages extract
Jul 23 11:07:33 localhost kernel: BTRFS error (device sdc): cleaner transaction attach returned -30
Jul 23 11:07:34 localhost kernel: BTRFS info (device sdc): use lzo compression
Jul 23 11:07:34 localhost kernel: BTRFS info (device sdc): allowing degraded mounts
Jul 23 11:07:34 localhost kernel: BTRFS info (device sdc): disk space caching is enabled
Jul 23 11:07:34 localhost kernel: BTRFS info (device sdc): has skinny extents
Jul 23 11:07:34 localhost kernel: BTRFS info (device sdc): bdev /dev/sdc errs: wr 3488357, rd 690731, flush 457, corrupt 0, gen 0



btrfs file usage /export
Overall:
    Device size:                   9.10TiB
    Device allocated:              7.52TiB
    Device unallocated:            1.58TiB
    Device missing:                  0.00B
    Used:                          7.48TiB
    Free (estimated):            823.54GiB      (min: 823.54GiB)
    Data ratio:                       2.00
    Metadata ratio:                   2.00
    Global reserve:              512.00MiB      (used: 0.00B)

Data,RAID1: Size:3.74TiB, Used:3.72TiB
   /dev/sdb        2.40TiB
   /dev/sdc        2.41TiB
   /dev/sdd        1.49TiB
   /dev/sde      599.50GiB
   /dev/sdf      601.00GiB

Metadata,RAID10: Size:22.00GiB, Used:17.87GiB
   /dev/sdb        5.25GiB
   /dev/sdc        4.75GiB
   /dev/sdd        5.25GiB
   /dev/sde        3.75GiB
   /dev/sdf        3.00GiB

System,RAID10: Size:64.00MiB, Used:576.00KiB
   /dev/sdb       16.00MiB
   /dev/sdc       16.00MiB
   /dev/sdd       16.00MiB
   /dev/sdf       16.00MiB

Unallocated:
   /dev/sdb      327.25GiB
   /dev/sdc      325.75GiB
   /dev/sdd      327.25GiB
   /dev/sde      328.26GiB
   /dev/sdf      327.50GiB



btrfs --version
btrfs-progs v4.9.1


umount /export;mount /export
brings the file system back to read-write

Other files work ok, it only seems to be affecting /export/gw/hourly.3/usr/src/kernels/4.10.8-200.fc25.x86_64/include/config/dvb/lgdt3305.h

Comment 1 redhatbugzilla 2017-07-23 01:48:41 UTC
btrfs check --readonly --progress /dev/sdb
Checking filesystem on /dev/sdb
UUID: 46873ef3-d8e2-4c31-8c63-ef378e144fd8
checking extents [o]
checking free space cache [o]
checkingunresolved ref dir 95911271 index 1241513984 namelen 0 name  filetype 0 errors 3, no dir item, no dir index
        unresolved ref dir 95911271 index 3832619578981377792 namelen 255 name - filetype 0 errors 103, no dir item, no dir index, name too long
        unresolved ref dir 96036417 index 2017612633061982208 namelen 255 name  filetype 0 errors 103, no dir item, no dir index, name too long
        unresolved ref dir 95911271 index 45 namelen 10 name lgdt3305.h filetype 1 errors 4, no inode ref
        unresolved ref dir 96036417 index 45 namelen 10 name lgdt3305.h filetype 1 errors 4, no inode ref
root 5 inode 96587249 errors 100, file extent discount
Found file extent holes:
        start: 0, len: 16384
root 5 inode 96587251 errors 100, file extent discount
Found file extent holes:
        start: 12288, len: 8192
root 5 inode 96587260 errors 100, file extent discount
Found file extent holes:
        start: 0, len: 131072
root 5 inode 96587262 errors 100, file extent discount
Found file extent holes:
        start: 110592, len: 53248
root 5 inode 96587264 errors 100, file extent discount
Found file extent holes:
        start: 20480, len: 4096
        start: 28672, len: 4096
        start: 36864, len: 32768
        start: 73728, len: 32768
root 5 inode 96587267 errors 100, file extent discount
Found file extent holes:
        start: 0, len: 16384
checking fs roots [O]
found 4112223834112 bytes used err is 1
total csum bytes: 3996123988
total tree bytes: 19185319936
total fs tree bytes: 14099726336
total extent tree bytes: 801177600
btree space waste bytes: 2817807593
file data blocks allocated: 4093038514176
 referenced 4233813848064

Comment 2 redhatbugzilla 2017-07-24 00:19:31 UTC
Created attachment 1303386 [details]
Output of a BTRFS Check

Comment 3 redhatbugzilla 2017-07-24 00:29:12 UTC
Ran a 
btrfs check --repair --progress /dev/sdb
Results are attached

After running that, the file appears to have been removed and now I am left with some kind of rubbish in the file system. The output of an ls -l  shows:

ls: cannot access '': No such file or directory
ls: cannot access '3305.h-': No such file or directory
total 16
-????????? ? ?    ?       ?            ? ''
drwxr-xr-x 1 root root 1020 Jul 24 10:21  .
drwxr-xr-x 1 root root   94 Jul 24 10:23  ..
-????????? ? ?    ?       ?            ?  3305.h-

Comment 4 Laura Abbott 2018-02-28 03:37:54 UTC
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale. The kernel moves very fast so bugs may get fixed as part of a kernel update. Due to this, we are doing a mass bug update across all of the Fedora 26 kernel bugs.
 
Fedora 26 has now been rebased to 4.15.4-200.fc26.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you have moved on to Fedora 27, and are still experiencing this issue, please change the version to Fedora 27.
 
If you experience different issues, please open a new bug report for those.

Comment 5 redhatbugzilla 2018-04-09 21:51:10 UTC
I am unable to test. You took so long to do anything about this, the condition no longer exists. I think I rebuilt the file system.

Comment 6 Laura Abbott 2018-04-09 21:59:15 UTC
Thanks for letting us know.


Note You need to log in before you can comment on or make changes to this bug.