Changes by: yura
Update of /cvs/linux-ntfs/ntfsprogs/ntfsprogs
In directory delta357:/tmp/cvs-serv16740/ntfsprogs
Modified Files:
ntfsmount.c utils.c
Log Message:
force distro developers to fix their broken init scripts
Index: ntfsmount.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -p -r1.102 -r1.103
--- ntfsmount.c 25 Nov 2006 17:37:37 -0000 1.102
+++ ntfsmount.c 25 Nov 2006 21:44:35 -0000 1.103
@@ -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 *d
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);
Index: utils.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/ntfsprogs/utils.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -p -r1.68 -r1.69
--- utils.c 25 Nov 2006 18:38:47 -0000 1.68
+++ utils.c 25 Nov 2006 21:44:36 -0000 1.69
@@ -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
|