Re: Balance + Ctrl-C = forced readonly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2020/7/5 下午8:49, Hans van Kranenburg wrote:
> Hi,
> 
> This is Linux kernel 5.7.6 (the Debian package, 5.7.6-1).
> 
> So, I wanted to try out this new quicker balance interrupt thing, and
> the result was that I could crash the fs at my very first try using it,
> which was simply doing balance, and then pressing Ctrl-C.
> 
> Recipe to reproduce: Start balance, wait a few seconds, then press
> Ctrl-C. For me here, ~ 5 out of 10 times, it ends up exploding:
> 
> -# btrfs balance start --full /btrfs/
> ^C
> 
> [41190.572977] BTRFS info (device xvdb): balance: start -d -m -s
> [41190.573035] BTRFS info (device xvdb): relocating block group
> 73001861120 flags metadata
> [41205.409600] BTRFS info (device xvdb): found 12236 extents, stage:
> move data extents
> [41205.509316] BTRFS info (device xvdb): relocating block group
> 71928119296 flags data
> [41205.695319] BTRFS info (device xvdb): found 3 extents, stage: move
> data extents
> [41205.723009] BTRFS info (device xvdb): found 3 extents, stage: update
> data pointers
> [41205.750590] BTRFS info (device xvdb): relocating block group
> 60922265600 flags metadata
> [41208.183424] BTRFS: error (device xvdb) in btrfs_drop_snapshot:5505:
> errno=-4 unknown

-4 means -EINTR.

It means during btrfs balance, signal could interrupt code running in
kernel space??!!

I thought when we fall into the balance ioctl, we're unable to
receive/handle signal, as we are in the kernel space, while signal
handling are all handled in user space.

Or is there some config or out-of-tree patches make it possible? Is this
specific to Debian kernels?
At least I tried several times with upstream kernel, unable to reproduce
it yet (maybe my fs is too small?)

If it's config related, then we must re-consider a lot of error handling.

Thanks,
Qu
> [41208.183450] BTRFS info (device xvdb): forced readonly
> [41208.183469] BTRFS info (device xvdb): balance: ended with status: -4
> 
> Boom, readonly FS.
> 
> Hans
> 

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux