• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Révision735b60ebc2c293688d89bd311494ce8f61ba6475 (tree)
l'heure2009-05-19 03:17:40
AuteurSan Mehat <san@goog...>
CommiterThe Android Open Source Project

Message de Log

am 7edc4f94: vold: If a filesystem is read/only then restart the fscheck but don\'t make any changes

Merge commit '7edc4f9454f1665b73faf0c02543cf350b741a53'

* commit '7edc4f9454f1665b73faf0c02543cf350b741a53':

vold: If a filesystem is read/only then restart the fscheck but don't make any changes

Change Summary

Modification

--- a/vold/volmgr_vfat.c
+++ b/vold/volmgr_vfat.c
@@ -39,6 +39,7 @@ int vfat_identify(blkdev_t *dev)
3939 int vfat_check(blkdev_t *dev)
4040 {
4141 int rc;
42+ boolean rw = true;
4243
4344 #if VFAT_DEBUG
4445 LOG_VOL("vfat_check(%d:%d):", dev->major, dev->minor);
@@ -50,47 +51,51 @@ int vfat_check(blkdev_t *dev)
5051 return 0;
5152 }
5253
53-#ifdef VERIFY_PASS
54- char *args[7];
55- args[0] = FSCK_MSDOS_PATH;
56- args[1] = "-v";
57- args[2] = "-V";
58- args[3] = "-w";
59- args[4] = "-p";
60- args[5] = blkdev_get_devpath(dev);
61- args[6] = NULL;
62- rc = logwrap(6, args);
63- free(args[5]);
64-#else
65- char *args[6];
66- args[0] = FSCK_MSDOS_PATH;
67- args[1] = "-v";
68- args[2] = "-w";
69- args[3] = "-p";
70- args[4] = blkdev_get_devpath(dev);
71- args[5] = NULL;
72- rc = logwrap(5, args);
73- free(args[4]);
74-#endif
54+ do {
55+
56+ char *args[6];
57+ args[0] = FSCK_MSDOS_PATH;
58+ args[1] = "-v";
59+
60+ if (rw) {
61+ args[2] = "-w";
62+ args[3] = "-p";
63+ args[4] = blkdev_get_devpath(dev);
64+ args[5] = NULL;
65+ rc = logwrap(5, args);
66+ free(args[4]);
67+ } else {
68+ args[2] = "-n";
69+ args[3] = blkdev_get_devpath(dev);
70+ args[4] = NULL;
71+ rc = logwrap(4, args);
72+ free(args[3]);
73+ }
74+
75+ if (rc == 0) {
76+ LOG_VOL("Filesystem check completed OK");
77+ return 0;
78+ } else if (rc == 1) {
79+ LOG_VOL("Filesystem check failed (general failure)");
80+ return -EINVAL;
81+ } else if (rc == 2) {
82+ LOG_VOL("Filesystem check failed (invalid usage)");
83+ return -EIO;
84+ } else if (rc == 4) {
85+ LOG_VOL("Filesystem check completed (errors fixed)");
86+ } else if (rc == 6) {
87+ LOG_VOL("Filesystem read-only - retrying check RO");
88+ rw = false;
89+ continue;
90+ } else if (rc == 8) {
91+ LOG_VOL("Filesystem check failed (not a FAT filesystem)");
92+ return -ENODATA;
93+ } else {
94+ LOG_VOL("Filesystem check failed (unknown exit code %d)", rc);
95+ return -EIO;
96+ }
97+ } while (0);
7598
76- if (rc == 0) {
77- LOG_VOL("Filesystem check completed OK");
78- return 0;
79- } else if (rc == 1) {
80- LOG_VOL("Filesystem check failed (general failure)");
81- return -EINVAL;
82- } else if (rc == 2) {
83- LOG_VOL("Filesystem check failed (invalid usage)");
84- return -EIO;
85- } else if (rc == 4) {
86- LOG_VOL("Filesystem check completed (errors fixed)");
87- } else if (rc == 8) {
88- LOG_VOL("Filesystem check failed (not a FAT filesystem)");
89- return -ENODATA;
90- } else {
91- LOG_VOL("Filesystem check failed (unknown exit code %d)", rc);
92- return -EIO;
93- }
9499 return 0;
95100 }
96101