Small enchantments and cleanups from ntfs-3g

edge.strict_endians
Yura Pakhuchiy 2007-09-03 19:51:01 +03:00
parent 3b64a5a512
commit 95b044cff3
3 changed files with 19 additions and 4 deletions

View File

@ -1395,8 +1395,16 @@ done:
if (ctx)
ntfs_attr_put_search_ctx(ctx);
/* Update mapping pairs if needed. */
if (need_to.update_mapping_pairs)
ntfs_attr_update_mapping_pairs(na, update_from);
if (need_to.update_mapping_pairs) {
if (ntfs_attr_update_mapping_pairs(na, update_from)) {
/* FIXME: We want rollback here. */
ntfs_log_perror("%s(): Failed to update mapping pairs. "
"Leaving inconsistent metadata. "
"Run chkdsk!", __FUNCTION__);
errno = EIO;
return -1;
}
}
/* Finally, return the number of bytes written. */
return total;
rl_err_out:

View File

@ -165,7 +165,7 @@ static const struct fuse_opt ntfs_fuse_opts[] = {
static const char *EXEC_NAME = "ntfsmount";
static char ntfs_fuse_default_options[] =
"default_permissions,allow_other,use_ino,kernel_cache";
"default_permissions,allow_other,use_ino,kernel_cache,nonempty";
static ntfs_fuse_context_t *ctx;
/**
@ -711,7 +711,7 @@ static int ntfs_fuse_write(const char *org_path, const char *buf, size_t size,
}
while (size) {
res = ntfs_attr_pwrite(na, offset, size, buf);
if (res < (s64)size)
if (res < (s64)size && errno != ENOSPC)
ntfs_log_error("ntfs_attr_pwrite returned less bytes "
"than requested.\n");
if (res <= 0) {

View File

@ -122,6 +122,11 @@ static const char *dirty_volume_msg =
"(NOT to us!) that init scripts kill ntfsmount or mount.ntfs-fuse during\n"
"shutdown instead of proper umount.\n";
static const char *fakeraid_msg =
"You seem to have a SoftRAID/FakeRAID hardware and must use an activated,\n"
"different device under /dev/mapper, (e.g. /dev/mapper/nvidia_eahaabcc1)\n"
"to mount NTFS. Please see the 'dmraid' documentation for help.\n";
/**
* utils_set_locale
*/
@ -227,6 +232,8 @@ ntfs_volume * utils_mount_volume(const char *device, unsigned long flags,
ntfs_log_error("%s", unclean_journal_msg);
else if (errno == EBUSY)
ntfs_log_error("%s", opened_volume_msg);
else if (errno == ENXIO)
ntfs_log_error("%s", fakeraid_msg);
return NULL;
}