Austin S. Hemmelgarn posted on Wed, 16 Mar 2016 11:26:11 -0400 as excerpted: > Currently, open_ctree_fs_info will open whatever path you pass it and > try to interpret it as a BTRFS filesystem. While this is not > nessecarily dangerous (except possibly if done on a character device), > it does result in some rather cryptic and non-sensical error messages > when trying to run certain commands in ways they weren't intended to be > run. Add a check using stat(2) to verify that the path we've been > passed is in fact a regular file or a block device. > > This causes the following commands to provide a helpful error message > when run on a FIFO, directory, character device, or socket: Umm... what about a symlink? A symlink isn't a block device or regular file, but obviously with udev, symlinks to block devices /better/ work. Do you dereference symlinks before doing this check? -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
