Skip to contentSkip to conversation

Welcome to the "lvm-devel" mailing list

DISCUSSION Eric Wheeler 1 participant 1 message Sep 5, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Good day all,

Today I was playing with lvmthin and did a metadata dump and restore with thin_dump. I was low on space so I thin_dump --repaired through gzip into restore.xml.gz, and hoped to

zcat restore.xml.gz | thin_restore -i /proc/self/fd/0 -o /dev/mapper/pool-pool_tmeta

but it says /proc/self/fd/0 is "Not a regular file" ... which of course it isn't.

Watching lsof -o on thin_restore indicates a linear progression through the input (looks like a simple ifstream), so technically, I believe it could support this.

persistent-data/file_utils.cc:~57:
persistent_data::check_file_exists(string const &file) does the
"Regular file check."

It looks that persistent_data::check_file_exists is used in cache_restore and xml_parser::parse, both appear to read linearly without arbitrary seek so it might be safe to relax or modify that check.

Of course blindly skipping the "Not a regular file" bit might bypass possible problems if used to sanitize file existence elsewhere in the code---but at least for XML restores it would have saved me some time.

Please comment on whether or not this is a good idea and how it would best be implemented. This is my first runthrough on the userspace thinp tools, so your input expertise is appreciated!

-Eric

--
Eric Wheeler
eWheeler Inc
www.ewheeler.net