force distro developers to fix their broken init scripts

edge.strict_endians
yura 2006-11-25 21:44:35 +00:00
parent f738f39bdf
commit fbfbe3b48e
2 changed files with 22 additions and 2 deletions

View File

@ -101,6 +101,7 @@ typedef struct {
BOOL debug;
BOOL noatime;
BOOL no_detach;
BOOL leave_dirty;
} ntfs_fuse_context_t;
typedef enum {
@ -1359,6 +1360,10 @@ exit:
static void ntfs_fuse_destroy(void *priv __attribute__((unused)))
{
if (ctx->vol) {
if (!ctx->leave_dirty && ntfs_volume_write_flags(ctx->vol,
ctx->vol->flags & ~VOLUME_IS_DIRTY))
ntfs_log_error("Failed to clear volume dirty flag. "
"OK, leave it, chkdsk will handle.\n");
ntfs_log_info("Unmounting %s (%s)\n", opts.device,
ctx->vol->vol_name);
if (ntfs_umount(ctx->vol, FALSE))
@ -1426,10 +1431,20 @@ static int ntfs_fuse_mount(const char *device)
return -1;
}
ctx->vol = vol;
if (vol->flags & VOLUME_IS_DIRTY)
ctx->leave_dirty = TRUE;
else {
if (ntfs_volume_write_flags(vol, vol->flags |
VOLUME_IS_DIRTY)) {
ntfs_log_perror("Failed to set temporary dirty flag");
ntfs_umount(vol, FALSE);
ctx->vol = NULL;
return -1;
}
}
return 0;
}
static void signal_handler(int arg __attribute__((unused)))
{
fuse_exit((fuse_get_context())->fuse);

View File

@ -114,7 +114,12 @@ static const char *opened_volume_msg =
static const char *dirty_volume_msg =
"Volume is scheduled for check.\n"
"Please boot into Windows TWICE, or use the 'force' option.\n";
"Please boot into Windows TWICE, or use the 'force' option.\n"
"NOTE: If you had not scheduled check and last time accessed this volume\n"
"using ntfsmount and shutdown system properly, then init scripts in your\n"
"distribution are broken. Please report to your distribution developers\n"
"(NOT to us!) that init scripts kill ntfsmount or mount.ntfs-fuse during\n"
"shutdown instead of proper umount.\n";
/**
* utils_set_locale