Git Product home page Git Product logo

Comments (6)

namjaejeon avatar namjaejeon commented on June 18, 2024 1

@devurandom You can reopen if you can reproduce same issue on broken exfat later.

from exfatprogs.

devurandom avatar devurandom commented on June 18, 2024

Is it possible that this:

exfatprogs/fsck/repair.c

Lines 64 to 66 in 7c3b617

if (exfat->options & FSCK_OPTS_REPAIR_NO ||
pr->flags & ERF_DEFAULT_NO)
repair = false;

always sets repair = false for problems which have a "no" default, like the cluster problems:

exfatprogs/fsck/repair.c

Lines 39 to 43 in 7c3b617

{ER_FILE_INVALID_CLUS, ERF_DEFAULT_NO, ERP_TRUNCATE},
{ER_FILE_FIRST_CLUS, ERF_DEFAULT_NO, ERP_TRUNCATE},
{ER_FILE_SMALLER_SIZE, ERF_DEFAULT_NO, ERP_TRUNCATE},
{ER_FILE_LARGER_SIZE, ERF_DEFAULT_NO, ERP_TRUNCATE},
{ER_FILE_DUPLICATED_CLUS, ERF_DEFAULT_NO, ERP_TRUNCATE},

?

From a user point of view I could imagine it to work like this:

bool ask_repair(struct exfat *exfat, struct exfat_repair_problem *pr) {
  if (!(exfat->options & FSCK_OPTS_REPAIR_ALL)) {
    return false;
  }

  bool repair = false;
  bool have_choice = false;
  if (exfat->options & FSCK_OPTS_REPAIR_AUTO) {
    if (pr->flags & ERF_DEFAULT_YES) {
      repair = true;
      have_choice = true;
    } else if (pr->flags & ERF_DEFAULT_NO) {
      repair = false;
      have_choice = true;
    }
  } else if (exfat->options & FSCK_OPTS_REPAIR_YES) {
    repair = true;
    have_choice = true;
  } else if (exfat->options & FSCK_OPTS_REPAIR_NO) {
    repair = false;
    have_choice = true;
  }

  if (!have_choice) {
    // ask user
  }

  return repair;
}

from exfatprogs.

hclee avatar hclee commented on June 18, 2024

The current version can repair only checksum corruptions, and refuse fixing the other corruptions with "n".

from exfatprogs.

namjaejeon avatar namjaejeon commented on June 18, 2024

@devurandom

Please try to run fsck.exfat on #exfat-next branch.

git clone --branch=exfat-next https://github.com/exfatprogs/exfatprogs

from exfatprogs.

devurandom avatar devurandom commented on June 18, 2024

I currently do not have a broken exFAT partition to test this with.

from exfatprogs.

namjaejeon avatar namjaejeon commented on June 18, 2024

Okay...

from exfatprogs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.