From b9c96ea703dcc84fcd8e3c051617c25579c4e4e1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Oct 2022 16:25:54 -0600 Subject: mount: Allow ignoring file checksum errors --- cmd/btrfs-rec/inspect_mount.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cmd/btrfs-rec') 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) } -- cgit v1.2.3-2-g168b