* How to efficiently remove a subvolume with children located further than BTRFS_INO_LOOKUP_PATH_MAX?
@ 2018-02-05 17:59 Nikita Gerasimov
0 siblings, 0 replies; only message in thread
From: Nikita Gerasimov @ 2018-02-05 17:59 UTC (permalink / raw)
To: linux-btrfs
Hi All,
I have an issue with recursively subvolume deletion when child created further than PATH_MAX.
As I understand current algorithm is:
- Find child by BTRFS_IOC_TREE_SEARCH, which is work fine.
- Get relative path to child by BTRFS_IOC_INO_LOOKUP. (that's a problem)
- Open child fd and recursively repeat until BTRFS_IOC_TREE_SEARCH could found something.
So when relative path is not fit into BTRFS_INO_LOOKUP_PATH_MAX,
BTRFS_IOC_INO_LOOKUP return ENAMETOOLONG and zeros as btrfs_ioctl_ino_lookup_args.
The only way I can see by far is walk through parent fs tree to find objects
matching by name with BTRFS_IOC_TREE_SEARCH results and check them byfstat. It doesn't look very good in terms of performance. Is there any
shorter way to get fd by child btrfs_root_ref?
Also btrfs-progs are fail to delete subvolumes with canonical path > PATH_MAX
because of realpath also return ENAMETOOLONG. At the same time creation by
relative path works fine.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-02-05 18:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-05 17:59 How to efficiently remove a subvolume with children located further than BTRFS_INO_LOOKUP_PATH_MAX? Nikita Gerasimov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).