Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2015-01-05 Thread Luis Henriques
Hi Sebastiann,

On Mon, Jan 05, 2015 at 12:01:06AM +, Andy Whitcroft wrote:
 On Sun, Jan 04, 2015 at 07:05:24PM +0100, Sebastiaan L. Zoutendijk wrote:
  Control: submitter -1 !
  
  Hello Joe,
  
  On Sat  3 Jan 2015 at 16:02:12 -0500, Joseph Salisbury wrote:
   Would it be possible for you to also open a bug in Launchpad for
   this?  It can be done by running the following from a terminal:
   
   ubuntu-bug linux
  
  Thank you for your directions, but I fear I wasn't clear enough in my
  previous mail.  This is not a bug specific to Ubuntu (I am not even
  using Ubuntu), this is a bug in the Extended Stable 3.16 kernel [1], the
  upstream for both Ubuntu and Debian.  The wiki page [2] told me to send
  a mail to this address.
  
[1] 
  http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y
[2] https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
  
  If I still should file a Launchpad bug, where should I file it?  Not at
  the Ubuntu package, I'd think?  But I can't find a Launchpad project for
  the Extended Stable kernel.
  
  Sorry for the confusion,
 
 Kamal, Henrix, one to consider.
 
 -apw
 
 -- 
 kernel-team mailing list
 kernel-t...@lists.ubuntu.com
 https://lists.ubuntu.com/mailman/listinfo/kernel-team

Thank you for reporting this issue (and sorry for the delay in my
reply!).  I am queuing this commit for the next 3.16 kernel release.

Cheers,
--
Luís


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2015-01-04 Thread Sebastiaan L. Zoutendijk
Control: submitter -1 !

Hello Joe,

On Sat  3 Jan 2015 at 16:02:12 -0500, Joseph Salisbury wrote:
 Would it be possible for you to also open a bug in Launchpad for
 this?  It can be done by running the following from a terminal:
 
 ubuntu-bug linux

Thank you for your directions, but I fear I wasn't clear enough in my
previous mail.  This is not a bug specific to Ubuntu (I am not even
using Ubuntu), this is a bug in the Extended Stable 3.16 kernel [1], the
upstream for both Ubuntu and Debian.  The wiki page [2] told me to send
a mail to this address.

  [1] 
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y
  [2] https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

If I still should file a Launchpad bug, where should I file it?  Not at
the Ubuntu package, I'd think?  But I can't find a Launchpad project for
the Extended Stable kernel.

Sorry for the confusion,

-- 
Sebastiaan L. Zoutendijk


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2015-01-04 Thread Andy Whitcroft
On Sun, Jan 04, 2015 at 07:05:24PM +0100, Sebastiaan L. Zoutendijk wrote:
 Control: submitter -1 !
 
 Hello Joe,
 
 On Sat  3 Jan 2015 at 16:02:12 -0500, Joseph Salisbury wrote:
  Would it be possible for you to also open a bug in Launchpad for
  this?  It can be done by running the following from a terminal:
  
  ubuntu-bug linux
 
 Thank you for your directions, but I fear I wasn't clear enough in my
 previous mail.  This is not a bug specific to Ubuntu (I am not even
 using Ubuntu), this is a bug in the Extended Stable 3.16 kernel [1], the
 upstream for both Ubuntu and Debian.  The wiki page [2] told me to send
 a mail to this address.
 
   [1] 
 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y
   [2] https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
 
 If I still should file a Launchpad bug, where should I file it?  Not at
 the Ubuntu package, I'd think?  But I can't find a Launchpad project for
 the Extended Stable kernel.
 
 Sorry for the confusion,

Kamal, Henrix, one to consider.

-apw


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2015-01-03 Thread Joseph Salisbury

On 12/23/2014 09:34 AM, Sebastiaan L. Zoutendijk wrote:

Dear Ubuntu Kernel Team,

I would like to request an upstream patch [1] to be applied to the 3.16
kernel.  This patch prevents Btrfs filesystems from going readonly when
a subvolume ID is reused but the corresponding qgroup wasn't destroyed
when the original subvolume was deleted.  This patch has been applied by
upstream to 3.17 [2], but not to 3.16 before it went EOL.  For more
details on the bug, please have a look at the Debian bug log [3].  That
log also contains instructions to reproduce the bug, dmesg output, and
my tests of the patch on various kernel versions.

  [1] https://patchwork.kernel.org/patch/4739211/
  [2] 
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=fe9133f10ca56e54c5f5075a802bc08e61ad8456
  [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769576

[Please keep 769576-forwar...@bugs.debian.org in the CC, this will log
your reply in the Debian bug tracker.  If you also want your reply to be
sent on to the Debian Kernel Team, please keep 769...@bugs.debian.org in
the CC.]

Would it be possible for you to also open a bug in Launchpad for this?  
It can be done by running the following from a terminal:


ubuntu-bug linux

Thanks,

Joe


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2014-12-23 Thread Sebastiaan L. Zoutendijk
Control: found -1 3.16.7-ckt2-1

On Thu 27 Nov 2014 at 19:41:20 +0100, Sebastiaan L. Zoutendijk wrote:
 On kernel 3.16.7-2, which is in sid and jessie, I have also been able to
 reproduce the bug, with the same kind of error messages in dmesg.
 Applying the patch again solved the issue.  As I suspected, this bug is
 present in the latest official Debian kernel to be shipped with jessie.

I have checked again with the latest unstable kernel: the problem is
still present and the patch still fixes it.  As we now have a new
upstream for the 3.16 kernel, I'll forward this bug to the ckt in a few
minutes.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2014-12-23 Thread Sebastiaan L. Zoutendijk
Dear Ubuntu Kernel Team,

I would like to request an upstream patch [1] to be applied to the 3.16
kernel.  This patch prevents Btrfs filesystems from going readonly when
a subvolume ID is reused but the corresponding qgroup wasn't destroyed
when the original subvolume was deleted.  This patch has been applied by
upstream to 3.17 [2], but not to 3.16 before it went EOL.  For more
details on the bug, please have a look at the Debian bug log [3].  That
log also contains instructions to reproduce the bug, dmesg output, and
my tests of the patch on various kernel versions.

 [1] https://patchwork.kernel.org/patch/4739211/
 [2] 
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=fe9133f10ca56e54c5f5075a802bc08e61ad8456
 [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769576

[Please keep 769576-forwar...@bugs.debian.org in the CC, this will log
your reply in the Debian bug tracker.  If you also want your reply to be
sent on to the Debian Kernel Team, please keep 769...@bugs.debian.org in
the CC.]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2014-11-27 Thread Sebastiaan L. Zoutendijk
Control: found -1 3.16.7-2

On Wed 26 Nov 2014 at 15:12:59 +0100, Bas Zoutendijk wrote:
 Subsequently, I applied the patch to the Debian sources of this kernel
 and rebuilt it.  I could not reproduce the bug on this patched kernel,
 so the patch seems to work.  Maybe I can try this with an official
 jessie kernel sometime soon, but I doubt the result will be different.

On kernel 3.16.7-2, which is in sid and jessie, I have also been able to
reproduce the bug, with the same kind of error messages in dmesg.
Applying the patch again solved the issue.  As I suspected, this bug is
present in the latest official Debian kernel to be shipped with jessie.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2014-11-26 Thread Bas Zoutendijk
Control: found 3.16.5-1~bpo70+1

On Fri 14 Nov 2014 at 17:51:17 +0100, Sebastiaan L. Zoutendijk wrote:
 There is a patch for this bug upstream [1], which has been applied to
 3.17 [2].  As far as I know, it wasn't applied to 3.16.  I have not
 tried this patch for reasons of time, but I can if you want me to.  The
 patch is also included at the end of this mail.
 
  [1] https://patchwork.kernel.org/patch/4739211/
  [2] 
 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=fe9133f10ca56e54c5f5075a802bc08e61ad8456

I have tried and succeeded to reproduce this in the latest version
backported to wheezy, 3.16.1-1~bpo70+1 a.k.a. 3.16-0.bpo.3.  Command
output was the same, uname and dmesg are below

$ uname -a
Linux andromeda 3.16-0.bpo.3-amd64 #1 SMP Debian 3.16.5-1~bpo70+1 (2014-11-02) 
x86_64 GNU/Linux
$ dmesg
[*snip*]
[  119.583914] [ cut here ]
[  119.583951] WARNING: CPU: 0 PID: 3698 at 
/build/linux-LrLd2z/linux-3.16.5/fs/btrfs/super.c:259 
__btrfs_abort_transaction+0x5f/0x140 [btrfs]()
[  119.583954] BTRFS: Transaction aborted (error -17)
[  119.583956] Modules linked in: ppdev lp nfsd auth_rpcgss oid_registry 
nfs_acl nfs lockd fscache sunrpc ctr ccm ext4 crc16 mbcache jbd2 
snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel 
snd_hda_controller snd_hda_codec snd_hwdep intel_powerclamp iTCO_wdt snd_pcm 
evdev arc4 iTCO_vendor_support snd_seq ath9k ath9k_common ath9k_hw i915 ath 
video drm_kms_helper drm mac80211 i2c_algo_bit i2c_i801 psmouse serio_raw 
snd_seq_device pcspkr tpm_infineon snd_timer parport_pc snd parport i2c_core 
tpm_tis acpi_cpufreq asus_atk0110 cfg80211 lpc_ich soundcore rfkill tpm 
mfd_core processor mei_me mei kvm_intel button kvm thermal_sys btrfs xor 
raid6_pq dm_crypt dm_mod ses enclosure usb_storage hid_generic usbhid hid sg 
sr_mod sd_mod cdrom crc_t10dif ata_generic crct10dif_pclmul crct10dif_common 
crc32_pclmul crc32c_intel ata_piix ghash_clmulni_intel aesni_intel ehci_pci 
ehci_hcd libata aes_x86_64 scsi_mod lrw r8169 gf128mul mii glue_helper 
ablk_helper cryptd usbcore usb_common
[  119.584043] CPU: 0 PID: 3698 Comm: btrfs Not tainted 3.16-0.bpo.3-amd64 #1 
Debian 3.16.5-1~bpo70+1
[  119.584046] Hardware name: System manufacturer System Product Name/P7H55-M, 
BIOS 110108/18/2010
[  119.584048]   a02d1a28 8154144f 
88020ce179f8
[  119.584052]  8106ce5c ffef 8800d7e2b800 
8800d95a9980
[  119.584056]  050d a02ce080 8106cf4a 
a02d1b08
[  119.584060] Call Trace:
[  119.584070]  [8154144f] ? dump_stack+0x41/0x51
[  119.584077]  [8106ce5c] ? warn_slowpath_common+0x8c/0xc0
[  119.584082]  [8106cf4a] ? warn_slowpath_fmt+0x4a/0x50
[  119.584099]  [a0242906] ? btrfs_run_delayed_refs+0x246/0x2a0 
[btrfs]
[  119.584112]  [a0224e0f] ? __btrfs_abort_transaction+0x5f/0x140 
[btrfs]
[  119.584129]  [a02521ff] ? create_pending_snapshot+0x60f/0xa00 
[btrfs]
[  119.584142]  [a022c98e] ? read_block_for_search.isra.40+0xce/0x3d0 
[btrfs]
[  119.584160]  [a0252679] ? create_pending_snapshots+0x89/0xa0 
[btrfs]
[  119.584178]  [a025396a] ? btrfs_commit_transaction+0x35a/0xa10 
[btrfs]
[  119.584197]  [a0287b83] ? btrfs_mksubvol.isra.62+0x4d3/0x4f0 
[btrfs]
[  119.584203]  [810b0080] ? __wake_up_sync+0x20/0x20
[  119.584220]  [a0287d5e] ? 
btrfs_ioctl_snap_create_transid+0x1be/0x1d0 [btrfs]
[  119.584238]  [a0287f15] ? btrfs_ioctl_snap_create_v2+0x115/0x150 
[btrfs]
[  119.584256]  [a028b09b] ? btrfs_ioctl+0x10bb/0x1ea0 [btrfs]
[  119.584262]  [81328609] ? fbcon_cursor+0x149/0x1f0
[  119.584266]  [810b47e2] ? up+0x12/0x50
[  119.584271]  [8132b280] ? update_attr.isra.3+0xa0/0xa0
[  119.584275]  [810c15c0] ? console_unlock+0x250/0x400
[  119.584279]  [810afd9e] ? remove_wait_queue+0x1e/0x70
[  119.584284]  [8138b84c] ? n_tty_write+0x1cc/0x4f0
[  119.584290]  [811f7a5c] ? fsnotify+0x1cc/0x260
[  119.584294]  [811cda26] ? do_vfs_ioctl+0x86/0x4e0
[  119.584299]  [811bbedc] ? vfs_write+0x17c/0x1f0
[  119.584303]  [811cdf21] ? SyS_ioctl+0xa1/0xc0
[  119.584307]  [8154792d] ? system_call_fast_compare_end+0x10/0x15
[  119.584310] ---[ end trace b118632d3508f5fe ]---
[  119.584314] BTRFS: error (device dm-0) in create_pending_snapshot:1293: 
errno=-17 Object already exists
[  119.584383] BTRFS info (device dm-0): forced readonly
[  119.584387] BTRFS warning (device dm-0): Skipping commit of aborted 
transaction.
[  119.584390] BTRFS: error (device dm-0) in cleanup_transaction:1571: 
errno=-17 Object already exists

Subsequently, I applied the patch to the Debian sources of this kernel
and rebuilt it.  I could not reproduce the bug on this patched kernel,
so the patch seems to work.  Maybe I can try this with an official
jessie 

Bug#769576: linux: Btrfs goes forced readonly when qgroup already exists

2014-11-14 Thread Sebastiaan L. Zoutendijk
Source: linux
Version: 3.16.3-2~bpo70+1
Severity: important
Tags: patch, upstream

Dear Maintainers,

[This bug is actually upstream, and I originally intended to send this
report upstream as well, but 3.16 has gone EOL before I got the time to
do this.  I hope the Debian maintainers will be able to tackle this
instead.]

Currently Btrfs does not destroy qgroups when the corresponding
subvolume is deleted.  Since Linux 3.16, it looks like Btrfs in some
cases tries to reuse subvolume IDs.  It then tries to create a qgroup
that already exists, as a consequence the filesystem is forced to
readonly.

The number of users effected by this is small, I think, because you must
use a Btrfs filesystem and enable quota on it (by default they're
disabled).  Nevertheless, for those that are affected, the system can
become practically unusable.  In my case, the filesystem went readonly
within an hour of every boot-up, when the backup program tried to create
snapshots.

There is a patch for this bug upstream [1], which has been applied to
3.17 [2].  As far as I know, it wasn't applied to 3.16.  I have not
tried this patch for reasons of time, but I can if you want me to.  The
patch is also included at the end of this mail.

 [1] https://patchwork.kernel.org/patch/4739211/
 [2] 
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=fe9133f10ca56e54c5f5075a802bc08e61ad8456

This is what I tried to reproduce the bug on a 3.16 kernel:

$ sudo btrfs sub snap / /test
Create a snapshot of '/' in '//test'
$ sudo btrfs sub del /test
Transaction commit: none (default)
Delete subvolume '//test'
$ sudo reboot
[*snip*]
$ sudo btrfs sub snap / /test
Create a snapshot of '/' in '//test'
ERROR: cannot snapshot '/' - File exists

Here are the details of the kernel and the Btrfs utilities, and the
dmesg output generated when doing the above procedure:

$ uname -a
Linux andromeda 3.16-0.bpo.2-amd64 #1 SMP Debian 3.16.3-2~bpo70+1 (2014-09-21) 
x86_64 GNU/Linux
$ /sbin/btrfs --version
Btrfs v3.14.1
$ sudo btrfs fi show
Label: 'Root'  uuid: 38dcce9b-0514-4690-b20c-cd203de41fce
Total devices 1 FS bytes used 107.49GiB
devid1 size 465.70GiB used 117.04GiB path 
/dev/disk/by-uuid/38dcce9b-0514-4690-b20c-cd203de41fce

Btrfs v3.14.1
$ sudo btrfs fi df /
Data, single: total=113.01GiB, used=106.33GiB
System, DUP: total=8.00MiB, used=16.00KiB
System, single: total=4.00MiB, used=0.00
Metadata, DUP: total=2.00GiB, used=1.16GiB
Metadata, single: total=8.00MiB, used=0.00
unknown, single: total=400.00MiB, used=0.00
$ dmesg
[*snip*]
[  115.885014] [ cut here ]
[  115.885042] WARNING: CPU: 2 PID: 3426 at 
/build/linux-nBoDV9/linux-3.16.3/fs/btrfs/super.c:259 
__btrfs_abort_transaction+0x5f/0x140 [btrfs]()
[  115.885043] BTRFS: Transaction aborted (error -17)
[  115.885044] Modules linked in: ppdev lp nfsd auth_rpcgss oid_registry 
nfs_acl nfs lockd fscache sunrpc ctr ccm ext4 crc16 mbcache jbd2 arc4 
snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ath9k 
ath9k_common ath9k_hw ath i915 snd_hda_intel pcspkr psmouse evdev serio_raw 
iTCO_wdt iTCO_vendor_support parport_pc mac80211 cfg80211 intel_powerclamp 
video parport rfkill snd_hda_controller tpm_infineon drm_kms_helper 
snd_hda_codec drm i2c_algo_bit asus_atk0110 tpm_tis tpm snd_hwdep lpc_ich 
mfd_core snd_pcm snd_seq snd_seq_device snd_timer mei_me mei acpi_cpufreq 
i2c_i801 i2c_core kvm_intel processor snd kvm thermal_sys button soundcore 
btrfs xor raid6_pq dm_crypt dm_mod ses enclosure usb_storage hid_generic usbhid 
hid sg sr_mod cdrom sd_mod crc_t10dif crct10dif_pclmul crct10dif_common 
crc32_pclmul crc32c_intel ata_generic ghash_clmulni_intel aesni_intel 
aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd ata_piix pata_via libata 
ehci_pci ehci_hcd r8169 scsi_mod mii usbcore usb_common
[  115.885095] CPU: 2 PID: 3426 Comm: btrfs Not tainted 3.16-0.bpo.2-amd64 #1 
Debian 3.16.3-2~bpo70+1
[  115.885096] Hardware name: System manufacturer System Product Name/P7H55-M, 
BIOS 110108/18/2010
[  115.885097]   a02d7a28 8153ff96 
8800ccaef9f8
[  115.885099]  8106be4c ffef 88007f8d4800 
8800c81d6020
[  115.885100]  050d a02d4080 8106bf3a 
a02d7b08
[  115.885102] Call Trace:
[  115.885110]  [8153ff96] ? dump_stack+0x41/0x51
[  115.885114]  [8106be4c] ? warn_slowpath_common+0x8c/0xc0
[  115.885116]  [8106bf3a] ? warn_slowpath_fmt+0x4a/0x50
[  115.885124]  [a0248906] ? btrfs_run_delayed_refs+0x246/0x2a0 
[btrfs]
[  115.885128]  [a022ae0f] ? __btrfs_abort_transaction+0x5f/0x140 
[btrfs]
[  115.885136]  [a02581ff] ? create_pending_snapshot+0x60f/0xa00 
[btrfs]
[  115.885148]  [a0258679] ? create_pending_snapshots+0x89/0xa0 
[btrfs]
[  115.885160]  [a025996a] ? btrfs_commit_transaction+0x35a/0xa10 
[btrfs]
[  115.885170]  [a028db83] ?