|
Line
Link Here
|
| 0 |
-- src/ntfs-3g.c |
0 |
++ src/ntfs-3g.c |
|
Lines 2230-2235
int main(int argc, char *argv[])
Link Here
|
| 2230 |
if (!ntfs_open(opts.device, opts.mnt_point, use_blkdev)) |
2230 |
if (!ntfs_open(opts.device, opts.mnt_point, use_blkdev)) |
| 2231 |
goto err_out; |
2231 |
goto err_out; |
| 2232 |
|
2232 |
|
|
|
2233 |
/* If ntfs_open fell back to MS_RDONLY, mount the filesystem read-only. */ |
| 2234 |
if (ctx->vol->flags & MS_RDONLY && ctx->ro != TRUE) { |
| 2235 |
ctx->ro = TRUE; |
| 2236 |
strcat(parsed_options, ",ro"); |
| 2237 |
} |
| 2238 |
|
| 2233 |
if (use_blkdev) { |
2239 |
if (use_blkdev) { |
| 2234 |
set_fuseblk_options(parsed_options); |
2240 |
set_fuseblk_options(parsed_options); |
| 2235 |
set_user_mount_option(parsed_options, uid); |
2241 |
set_user_mount_option(parsed_options, uid); |
| 2236 |
-- src/utils.c |
2242 |
++ src/utils.c |
|
Lines 88-93
Link Here
|
| 88 |
"Volume is scheduled for check. Please boot into Windows TWICE, or\n" |
88 |
"Volume is scheduled for check. Please boot into Windows TWICE, or\n" |
| 89 |
"use the 'force' mount option. For example type on the command line:\n"; |
89 |
"use the 'force' mount option. For example type on the command line:\n"; |
| 90 |
|
90 |
|
|
|
91 |
static const char *rdonly_fallback_msg ="\nMounting the volume read-only for now.\n"; |
| 92 |
|
| 91 |
static const char *forced_mount_msg = |
93 |
static const char *forced_mount_msg = |
| 92 |
"\n" |
94 |
"\n" |
| 93 |
" mount -t ntfs-3g %s %s -o force\n" |
95 |
" mount -t ntfs-3g %s %s -o force\n" |
|
Lines 118-123
ntfs_volume *utils_mount_volume(const ch
Link Here
|
| 118 |
{ |
120 |
{ |
| 119 |
ntfs_volume *vol; |
121 |
ntfs_volume *vol; |
| 120 |
|
122 |
|
|
|
123 |
retry_mount: |
| 121 |
vol = ntfs_mount(volume, flags); |
124 |
vol = ntfs_mount(volume, flags); |
| 122 |
if (!vol) { |
125 |
if (!vol) { |
| 123 |
|
126 |
|
|
Lines 141-154
ntfs_volume *utils_mount_volume(const ch
Link Here
|
| 141 |
return NULL; |
144 |
return NULL; |
| 142 |
} |
145 |
} |
| 143 |
|
146 |
|
| 144 |
if (vol->flags & VOLUME_IS_DIRTY) { |
147 |
if (!(flags & MS_RDONLY) && vol->flags & VOLUME_IS_DIRTY) { |
| 145 |
if (!force) { |
148 |
if (!force) { |
| 146 |
ntfs_log_error("%s", dirty_volume_msg); |
149 |
ntfs_log_error("%s", dirty_volume_msg); |
| 147 |
ntfs_log_error(forced_mount_msg, volume, mntpoint, |
150 |
ntfs_log_error(forced_mount_msg, volume, mntpoint, |
| 148 |
volume, mntpoint); |
151 |
volume, mntpoint); |
| 149 |
ntfs_umount(vol, FALSE); |
152 |
ntfs_umount(vol, FALSE); |
| 150 |
|
153 |
|
| 151 |
return NULL; |
154 |
ntfs_log_error("%s", rdonly_fallback_msg); |
|
|
155 |
fflush(stderr); |
| 156 |
flags |= MS_RDONLY; |
| 157 |
goto retry_mount; |
| 152 |
} else |
158 |
} else |
| 153 |
ntfs_log_error("WARNING: Forced mount, unclean volume " |
159 |
ntfs_log_error("WARNING: Forced mount, unclean volume " |
| 154 |
"information is ignored.\n"); |
160 |
"information is ignored.\n"); |