Re: [PATCH v2] btrfs-progs: add stat check in open_ctree_fs_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2016-03-18 11:17, David Sterba wrote:
On Fri, Mar 18, 2016 at 10:03:42AM -0400, Austin S. Hemmelgarn wrote:
There are other tools that have similarly poor error behavior when
called incorrectly (btrfs rescue immediately comes to mind), but they
don't use open_ctree_fs_info, so this doesn't affect them.  I may do
followup patches to fix those too if I have the time.

Yeah, it would be good to fix all.
I had a bit of spare time over lunch, and decided to take a cursory look. I hadn't realized that open_ctree uses open_ctree_fs_info, and it looks like almost everything that doesn't call open_ctree_fs_info calls open_ctree, which means this actually added error checking to a lot more than I realized, possibly everything that expects a filesystem image to operate on. I've checked btrfs rescue now, and with this change, it now gives a nice error for something other than a a file or block device. It looks like a follow up patch may not be necessary after all, I'll try and double check the rest of the commands that I haven't checked already over the weekend, and hopefully have something by Monday or Tuesday if there's anything else that needs this check added.

--
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




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux