diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-10-08 16:25:54 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-10-08 19:51:37 -0600 |
commit | b9c96ea703dcc84fcd8e3c051617c25579c4e4e1 (patch) | |
tree | 736630cc6f69d70d5f959cca32fb1a2b39b5315e /cmd/btrfs-rec/inspect_mount.go | |
parent | ceff7fa1fce0d6810c42ef6d57dcc2316e63c84b (diff) |
mount: Allow ignoring file checksum errors
Diffstat (limited to 'cmd/btrfs-rec/inspect_mount.go')
-rw-r--r-- | cmd/btrfs-rec/inspect_mount.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/btrfs-rec/inspect_mount.go b/cmd/btrfs-rec/inspect_mount.go index 5aae54a..cff33b6 100644 --- a/cmd/btrfs-rec/inspect_mount.go +++ b/cmd/btrfs-rec/inspect_mount.go @@ -13,14 +13,18 @@ import ( ) func init() { - inspectors = append(inspectors, subcommand{ + var skipFileSums bool + cmd := subcommand{ Command: cobra.Command{ Use: "mount MOUNTPOINT", Short: "Mount the filesystem read-only", Args: cliutil.WrapPositionalArgs(cobra.ExactArgs(1)), }, RunE: func(fs *btrfs.FS, cmd *cobra.Command, args []string) error { - return btrfsinspect.MountRO(cmd.Context(), fs, args[0]) + return btrfsinspect.MountRO(cmd.Context(), fs, args[0], skipFileSums) }, - }) + } + cmd.Command.Flags().BoolVar(&skipFileSums, "skip-filesums", false, + "ignore checksum failures on file contents; allow such files to be read") + inspectors = append(inspectors, cmd) } |