linux/fs/bcachefs
Guoyu Ou 0be5b38bce bcachefs: skip invisible entries in empty subvolume checking
When we are checking whether a subvolume is empty in the specified snapshot,
entries that do not belong to this subvolume should be skipped.

This fixes the following case:

    $ bcachefs subvolume create ./sub
    $ cd sub
    $ bcachefs subvolume create ./sub2
    $ bcachefs subvolume snapshot . ./snap
    $ ls -a snap
    . ..
    $ rmdir snap
    rmdir: failed to remove 'snap': Directory not empty

As Kent suggested, we pass 0 in may_delete_deleted_inode() to ignore subvols
in the subvol we are checking, because inode.bi_subvol is only set on
subvolume roots, and we can't go through every inode in the subvolume and
change bi_subvol when taking a snapshot. It makes the check less strict, but
that's ok, the rest of fsck will still catch it.

Signed-off-by: Guoyu Ou <benogy@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-10 15:34:07 -04:00
..
2024-01-01 11:47:07 -05:00
2024-01-21 06:01:45 -05:00
2024-03-10 15:18:45 -04:00
2024-01-01 11:47:44 -05:00
2024-01-21 06:01:45 -05:00
2024-01-01 11:46:52 -05:00
2024-01-21 13:27:10 -05:00
2024-01-05 23:24:21 -05:00
2024-01-21 13:27:11 -05:00
2024-01-21 06:01:45 -05:00
2024-01-05 23:24:19 -05:00
2023-12-19 19:01:52 -05:00
2024-01-01 11:47:44 -05:00
2024-01-21 13:27:11 -05:00
2024-03-10 15:12:13 -04:00
2024-01-21 13:27:10 -05:00
2024-01-21 13:27:10 -05:00
2024-01-21 06:01:45 -05:00
2024-03-10 15:12:54 -04:00
2024-02-13 21:59:27 -05:00
2024-01-01 11:47:07 -05:00
2024-01-21 13:27:10 -05:00
2024-01-21 13:27:11 -05:00
2024-01-21 06:01:45 -05:00
2024-01-21 06:01:45 -05:00
2024-01-01 11:47:07 -05:00
2024-01-01 11:47:40 -05:00
2024-01-21 13:27:10 -05:00
2024-01-10 16:34:17 -08:00
2024-01-05 23:24:21 -05:00
2024-03-10 15:30:56 -04:00
2024-02-25 15:45:36 -05:00
2024-01-21 13:27:10 -05:00