aboutsummaryrefslogtreecommitdiff
path: root/fsck.go
AgeCommit message (Collapse)Author
2020-07-18v2api: make fsck compile againJakob Unterwurzacher
Horribly broken, but it compiles. .../tests/fsck$ ./run_fsck.bash Reading password from extpass program "echo", arguments: ["test"] Decrypting master key OpenDir ".": invalid entry "invalid_file_name.3": illegal base64 data at input byte 17 OpenDir ".": invalid entry "invalid_file_name_2": bad message fsck: corrupt entry in dir "": "invalid_file_name.3" fsck: corrupt entry in dir "": "invalid_file_name_2" OpenDir ".": invalid entry "invalid_file_name____1": bad message fsck: corrupt entry in dir "": "invalid_file_name____1" fsck: error stating file ".go-fuse.5577006791947779410/deleted": no such file or directory fsck: error listing xattrs on ".go-fuse.13260572831089785859/deleted": no such file or directory fsck: error opening dir "i10488239 (dir): ": no such file or directory fsck: error reading symlink ".go-fuse.10667007354186551956/deleted": no such file or directory fsck: error listing xattrs on ".go-fuse.11998794077335055257/deleted": no such file or directory [...]
2020-06-21v2api (go-fuse v2 api): initial noop implementationJakob Unterwurzacher
Compiles and mounts but does nothing useful.
2020-05-17Update go-fuse import path to github.com/hanwen/go-fuse/v2Jakob Unterwurzacher
We need https://github.com/hanwen/go-fuse/commit/fd7328faf9fdf75709f7ba7df7072aaf4eeb18b3 to fix a crash reported in https://github.com/rfjakob/gocryptfs/issues/430 : 2019/10/30 17:14:16 Unknown opcode 2016 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x508d38] This patch is only in the v2.x.x branch. Upgrade to v2, as the old API is also supported there. Running git grep hanwen/go-fuse | grep -v hanwen/go-fuse/v2 to check for forgotten references comes back clean.
2019-01-04fsck: don't misdetect a file hole at EOFJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/304 : A second minor issue is that `if bytes.Equal(buf, allZero) {` compares the whole buffer, although the last read could have been shorter. This could trigger the "skip file hole" code at the end of a file although there isn't any hole to skip.
2019-01-04fsck: Do not show files/directories without access permissions as corrupt.Sebastian Lackner
When running as a regular user, error EACCES does not necessarily mean that the file/directory/xattr is corrupt, but just that we do not have sufficient access permissions. Add a hint that running as root can be used to check everything. Fixes: https://github.com/rfjakob/gocryptfs/issues/309
2018-12-27Assorted spelling fixes.Sebastian Lackner
Mostly detected with the 'codespell' utility, but also includes some manual grammar fixes.
2018-08-15fsck: skip already-seen hard-linked filesJakob Unterwurzacher
We may hit files several times due to hard links. Only check the contents once.
2018-08-15fsck: don't print corse corruption offsetJakob Unterwurzacher
The exact ciphertext block number (4KiB granularity) is already printed in the doRead message. Don't cause confusion by printing the 128KiB-granularity offset as well. doRead 767: corrupt block #4: stupidgcm: message authentication failed fsck: error reading file "pa/d7/d14/f10c" (inum 767): 5=input/output error
2018-07-23fsck: print inode number on file read errorJakob Unterwurzacher
This makes it possible to find the file without mounting the fs.
2018-07-15fsck: add debug output (enabled via -debug)Jakob Unterwurzacher
Turn the commented-out fmt.Printf into debug output via the tlog infrastructure.
2018-07-01fsck: handle sparse files efficiently, fix xfstests generic/285Jakob Unterwurzacher
If we encounter a 128KB block of zeros, try to skip to the next data section by calling File.SeekData(). This fixes xfstests generic/285, which creates a 17TB sparse file, and runs fsck afterwards. Without this optimization, fsck would take ages.
2018-07-01fsck: get rid of channel read closuresJakob Unterwurzacher
Create proper functions instead to declutter the logic.
2018-07-01fsck: rename "CorruptItems" channel to "MitigatedCorruptions"Jakob Unterwurzacher
Make it clear that this channel is only used to report corruptions that are transparently mitigated and do not return an error to the user.
2018-07-01fsck: suppress "no problems found" when running quietJakob Unterwurzacher
Passing "-q" now disables the "fsck summary: no problems found\n" message.
2018-04-03fsck: report skipped corrupt filesJakob Unterwurzacher
OpenDir and ListXAttr skip over corrupt entries, readFileID treats files the are too small as empty. This improves usability in the face of corruption, but hides the problem in a log message instead of putting it in the return code. Create a channel to report these corruptions to fsck so it can report them to the user. Also update the manpage and the changelog with the -fsck option. Closes https://github.com/rfjakob/gocryptfs/issues/191
2018-04-02fsck: add xattr supportJakob Unterwurzacher
With testcases.
2018-04-02fsck: clean up log outputJakob Unterwurzacher
Make sure we get only 1 warning output per problem. Also, add new corruption types to broken_fs_v1.4.
2018-04-02fsck: sort files alphabeticallyJakob Unterwurzacher
This makes fsck runs deterministic.
2018-04-02fsck: add initial implementationJakob Unterwurzacher
Most corruption cases except xattr should be covered. With test filesystem. The output is still pretty ugly. xattr support will be added in the next commits.
2018-04-01main: add "-fsck" flagJakob Unterwurzacher
The fsck operation is not yet implemented, this commits just adds the flag and improves cli flag handling.