All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: do not commit transaction to avoid deadly ENOSPC trap
@ 2023-07-27  6:07 Qu Wenruo
  2023-07-27  6:07 ` [PATCH 1/2] btrfs: do not commit transaction after adding one device Qu Wenruo
  2023-07-27  6:07 ` [PATCH 2/2] btrfs: do not commit transaction canceling a suspended replace Qu Wenruo
  0 siblings, 2 replies; 5+ messages in thread
From: Qu Wenruo @ 2023-07-27  6:07 UTC (permalink / raw)
  To: linux-btrfs

There is a report that a user hits a deadly ENOSPC trap, where the fs
would immediately falls read-only when commit any transaction.

To make the case worse, the fs is using RAID1C4 (later converted to
RAID1C3), this makes it impossible to add any extra disks.

As the kernel would commit the current transaction after just adding the
first device, while RAID1C4 needs 4 new disks, this would still trigger
ENOSPC during transaction committing.

The first patch would address the problem by not committing the
transaction adding a new device.

This would cause a behavior change, would need to co-operate with
btrfs-progs to allow end users to determine if they want to sync the fs
after adding all devices.

The second patch is to address a rare corner case hit by the same
reporter, that canceling a suspended replace would also trigger the
deadly ENOSPC trap.

Qu Wenruo (2):
  btrfs: do not commit transaction after adding one device
  btrfs: do not commit transaction canceling a suspended replace

 fs/btrfs/dev-replace.c | 10 ----------
 fs/btrfs/volumes.c     | 12 ++----------
 2 files changed, 2 insertions(+), 20 deletions(-)

-- 
2.41.0


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

end of thread, other threads:[~2023-07-27 22:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27  6:07 [PATCH 0/2] btrfs: do not commit transaction to avoid deadly ENOSPC trap Qu Wenruo
2023-07-27  6:07 ` [PATCH 1/2] btrfs: do not commit transaction after adding one device Qu Wenruo
2023-07-27  6:07 ` [PATCH 2/2] btrfs: do not commit transaction canceling a suspended replace Qu Wenruo
2023-07-27 12:09   ` David Sterba
2023-07-27 22:26     ` Qu Wenruo

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.