Summary:
Update the copyright & license headers in Python files to reflect the
relicensing to GPLv2
Reviewed By: wez
Differential Revision: D15487088
fbshipit-source-id: 9f2138dff41048d2c35f15e09a04ae5a9c9c80dd
Summary: Fix a few more issues raised by our Python lint checks.
Reviewed By: wez
Differential Revision: D15776717
fbshipit-source-id: 621960579c4567c4fb9395ae14cd7a8666726c1c
Summary: Remove a number of unused imports detected by the linter.
Reviewed By: wez
Differential Revision: D15776268
fbshipit-source-id: 221f45d275664d037bbabcac9858b40266b4833e
Summary:
Add a `__str__()` method to the `HardLinkedInode` error class, so it prints
useful information in the fsck logs. Previously it just printed the default
python `repr()` information, which includes the class name but not the inode
number and path details.
Reviewed By: strager
Differential Revision: D13165857
fbshipit-source-id: 68c7484ae65127653a48eb71ec0cd1be3fe8b85f
Summary:
Check that the next-inode-number file exists and that the inode number it
contains is actually larger than all existing inode numbers. Replace it with
correct data if the file does not exist, is corrupt, or contains an incorrect
inode number.
Reviewed By: chadaustin
Differential Revision: D12955093
fbshipit-source-id: 3d26fb475535577d9a2697bbd575fba350766d01
Summary:
Update fsck to extract data for orphan inodes to a lost+found directory in the
fsck log directory, and remove them from the overlay. This will allow users
to recover the orphan file data if they want, and remove it otherwise.
Reviewed By: chadaustin
Differential Revision: D12955094
fbshipit-source-id: 9783452fce4060b9c5c48b3d48dd1f70294211c6
Summary:
Add basic high level logic to fsck to begin fixing problems that are found.
This adds basic checks to decide if we should fix errors or not.
If errors are found and need to be fixed, this creates a new directory inside
the checkout state directory in `.eden` to record the actions taken by this
fsck run. This directory will contain a log file that records the actions
taken. In the future the fsck logic will also use this directory to store
copies of the corrupted inode data, and can store extracted orphan inode data
here as well.
Reviewed By: wez
Differential Revision: D12955044
fbshipit-source-id: 06c1e17a0a51fa5e2c0f2aab83b367b9358fd004
Summary:
Move the error printing logic up into the CLI-specific `FsckCmd` class and out
of the lower-level `fsck.FilesystemChecker` class.
Reviewed By: wez
Differential Revision: D12955043
fbshipit-source-id: 4b5a1fcb791e784c736672484990b5406ee29b65
Summary:
Improve the way `eden fsck` processes its arguments. Previously it required a
single checkout path as an argument. If an `--overlay` argument was specified
it used this instead of the checkout path to find the directory to check, but
the checkout path argument was still required (but was ignored).
This changes the code to accept one or more paths as arguments. These paths
can either be the path to an Eden checkout (which does not have be currently
mounted), or the path to a checkout state directory inside the `.eden` state
directory. The `fsck` code automatically figures out what type of directory
the argument refers to and processes it correctly.
If no paths are specified `eden fsck` now automatically checks all configured
checkouts that are not currently mounted.
Reviewed By: wez
Differential Revision: D12955041
fbshipit-source-id: c37bc6752746d8ecd0f4a672d0d3b25d1c3a4fa1
Summary:
Change how fsck reports orphan inodes so that it only creates a single Error
object tracking all orphan inodes.
This will make it easier to write code to fix the orphan inodes as we will
want to process all of the orphan inodes together.
Reviewed By: wez
Differential Revision: D9615337
fbshipit-source-id: 452d0e67f357b8b2ac3b24d89e23fffb5bd816fd
Summary:
Wait to print errors until after we have finished scanning all of the overlay
files. Previously we printed errors as they were detected. However we would
not be able to print the path names correctly if we had not processed all of
the inode's parents yet. This resulted in error messages incorrectly
displaying paths as unlinked in some cases.
Also improve the error strings shown for MissingMaterializedInode and
InvalidMaterializedInode to also include the inode number. Also correct the
inode type display for InvalidMaterializedInode.
Reviewed By: wez
Differential Revision: D9615336
fbshipit-source-id: eb273d51c937e76ffed0e021da848f5fb940145d
Summary:
This adds initial code for an `eden debug fsck` command.
At the moment this simply scans the overlay and reports errors, but does not
correct any issues. In subsequent diffs I'll update it to support correcting
some problems.
There are also several other issues that I'll improve in subsequent diffs as
well. At the moment this code uses the same functions as other CLI commands
to find the client directory, and these only work if the checkout is already
mounted. For `fsck` we generally want the checkout to be unmounted before
checking it. I also plan to clean up some of the output handling as well.
Reviewed By: strager
Differential Revision: D8813714
fbshipit-source-id: 90238e94540db1cc06c17eabf8ce3a1bb808d4b3