Commit Graph

16 Commits

Author SHA1 Message Date
generatedunixname89002005307016
3f46bd1142 Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: shannonzhu

Differential Revision: D18250419

fbshipit-source-id: b4ab494552f8ad6601224c03eab6ee5904b83255
2019-10-31 15:31:07 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
generatedunixname89002005289445
01d06886cb Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: sinancepel

Differential Revision: D16863919

fbshipit-source-id: c76f41992b9a1a57080eed932724b65c1fd846f5
2019-08-16 14:44:25 -07:00
Adam Simpkins
9bfb48c921 update license headers in .py files
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
2019-06-19 17:02:46 -07:00
Adam Simpkins
90f48a3105 fix a few additional python lint issues
Summary: Fix a few more issues raised by our Python lint checks.

Reviewed By: wez

Differential Revision: D15776717

fbshipit-source-id: 621960579c4567c4fb9395ae14cd7a8666726c1c
2019-06-12 14:00:57 -07:00
Adam Simpkins
20f211acb8 remove unused python imports
Summary: Remove a number of unused imports detected by the linter.

Reviewed By: wez

Differential Revision: D15776268

fbshipit-source-id: 221f45d275664d037bbabcac9858b40266b4833e
2019-06-12 14:00:57 -07:00
Adam Simpkins
d35c7f5fdf fsck: print errors about hard links correctly
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
2018-11-29 14:37:23 -08:00
Adam Simpkins
a16c28cec8 fsck: also check and fix the next-inode-number file
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
2018-11-27 14:35:01 -08:00
Adam Simpkins
a1b00e46d8 fsck: fix orphan inodes by extracting them to a lost+found directory
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
2018-11-27 14:35:01 -08:00
Adam Simpkins
37fee2742e update eden fsck to support fixing invalid inodes
Summary: Update `eden fsck` to support replacing missing or invalid overlay files.

Reviewed By: chadaustin

Differential Revision: D12955092

fbshipit-source-id: 1dc28de4d387dba2e7dae96397dd01ceb3edcf5c
2018-11-26 12:28:52 -08:00
Adam Simpkins
8574164ed5 fsck: add basic framework code for fixing errors
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
2018-11-26 12:28:52 -08:00
Adam Simpkins
a1a79d6271 move fsck error printing code into the main CLI module
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
2018-11-09 16:06:55 -08:00
Adam Simpkins
d7882dfa93 improve argument parsing for eden fsck
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
2018-11-09 16:06:55 -08:00
Adam Simpkins
95c4f2e72b fsck: report all orphan inodes as single error
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
2018-08-31 19:06:25 -07:00
Adam Simpkins
f15751255c improve some of the fsck output
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
2018-08-31 19:06:25 -07:00
Adam Simpkins
5fd3e0e6b9 initial start for an fsck command
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
2018-07-16 18:51:48 -07:00