~yuningdodo/ubuntu/trusty/util-linux/util-linux.backport-utopic-2.25-8ubuntu1

« back to all changes in this revision

Viewing changes to misc-utils/wipefs.c

  • Committer: Martin Pitt
  • Date: 2012-09-06 05:47:03 UTC
  • mto: This revision was merged to the branch mainline in revision 90.
  • Revision ID: martin.pitt@canonical.com-20120906054703-bvt3aaxkkt7839se
misc-utils/wipefs.c: In --all mode, wipe several times until no further
signatures are found. This is required for file systems like VFAT which
can be detected in multiple different ways. This is fixed properly in 2.21
(see LP #1012081), but does not backport well, so use this local hack for
now. (LP: #1046665)

Show diffs side-by-side

added added

removed removed

Lines of Context:
377
377
        if (optind != argc)
378
378
                errx(EXIT_FAILURE, _("only one device as argument is currently supported."));
379
379
 
380
 
        wp = read_offsets(wp, fname, all);
381
 
 
382
 
        if (wp) {
383
 
                if (has_offset || all)
384
 
                        do_wipe(wp, fname, noact);
385
 
                else
386
 
                        print_all(wp, mode);
387
 
 
388
 
                free_wipe(wp);
389
 
        }
 
380
        /* we need to wipe several times for some file systems like VFAT, see
 
381
         * https://launchpad.net/bugs/1046665 */
 
382
        do {
 
383
                wp = read_offsets(wp, fname, all);
 
384
 
 
385
                if (wp) {
 
386
                        if (has_offset || all)
 
387
                                do_wipe(wp, fname, noact);
 
388
                        else
 
389
                                print_all(wp, mode);
 
390
 
 
391
                        free_wipe(wp);
 
392
                        wp = NULL;
 
393
                } else
 
394
                        break;
 
395
        } while (!noact && all);
390
396
        return EXIT_SUCCESS;
391
397
}