From: Sven Hoexter Date: Sun, 6 Dec 2015 13:25:09 +0000 (+0100) Subject: Merge branch 'upstream' - import 1.2.2 X-Git-Tag: debian/1.2.2-1~3 X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Ffuse-exfat.git;a=commitdiff_plain;h=1195a0d2827751ef9791cd2ff1fe9b4b84ad45be;hp=2f7f0bbd80ca101aeec246e70b0b4b0ae754f282 Merge branch 'upstream' - import 1.2.2 --- diff --git a/ChangeLog b/ChangeLog index 2ff856c..d6f99d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1.2.2 (2015-11-09) + +* Improved reliability in case of a sudden unplug: FS will be in a clean state +after closing all files and performing sync(1). +* Fixed compilation on Debian GNU/kFreeBSD and GNU/Hurd platforms. +* Updated mount.exfat-fuse man page. + 1.2.1 (2015-09-24) * Fixed compatibility with Zalman VE-200: now newly created directories do not diff --git a/README b/README index 1e3dff5..8f2fe85 100644 --- a/README +++ b/README @@ -31,6 +31,10 @@ Then install driver and utilities: sudo make install +You can remove them using this command: + + sudo make uninstall + Mounting -------- diff --git a/configure b/configure index a3474b9..2f47ad1 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Free exFAT implementation 1.2.1. +# Generated by GNU Autoconf 2.69 for Free exFAT implementation 1.2.2. # # Report bugs to . # @@ -579,8 +579,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Free exFAT implementation' PACKAGE_TARNAME='fuse-exfat' -PACKAGE_VERSION='1.2.1' -PACKAGE_STRING='Free exFAT implementation 1.2.1' +PACKAGE_VERSION='1.2.2' +PACKAGE_STRING='Free exFAT implementation 1.2.2' PACKAGE_BUGREPORT='relan@users.noreply.github.com' PACKAGE_URL='https://github.com/relan/exfat' @@ -1238,7 +1238,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Free exFAT implementation 1.2.1 to adapt to many kinds of systems. +\`configure' configures Free exFAT implementation 1.2.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1304,7 +1304,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Free exFAT implementation 1.2.1:";; + short | recursive ) echo "Configuration of Free exFAT implementation 1.2.2:";; esac cat <<\_ACEOF @@ -1403,7 +1403,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Free exFAT implementation configure 1.2.1 +Free exFAT implementation configure 1.2.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1458,7 +1458,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Free exFAT implementation $as_me 1.2.1, which was +It was created by Free exFAT implementation $as_me 1.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2321,7 +2321,7 @@ fi # Define the identity of the package. PACKAGE='fuse-exfat' - VERSION='1.2.1' + VERSION='1.2.2' cat >>confdefs.h <<_ACEOF @@ -4839,7 +4839,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Free exFAT implementation $as_me 1.2.1, which was +This file was extended by Free exFAT implementation $as_me 1.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4906,7 +4906,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Free exFAT implementation config.status 1.2.1 +Free exFAT implementation config.status 1.2.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 1bff6fe..e50b0b8 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # AC_INIT([Free exFAT implementation], - [1.2.1], + [1.2.2], [relan@users.noreply.github.com], [fuse-exfat], [https://github.com/relan/exfat]) diff --git a/fuse/main.c b/fuse/main.c index 030362e..aad082b 100644 --- a/fuse/main.c +++ b/fuse/main.c @@ -206,6 +206,9 @@ static int fuse_exfat_fsync(const char* path, int datasync, int rc; exfat_debug("[%s] %s", __func__, path); + rc = exfat_flush_nodes(&ef); + if (rc != 0) + return rc; rc = exfat_flush(&ef); if (rc != 0) return rc; diff --git a/fuse/mount.exfat-fuse.8 b/fuse/mount.exfat-fuse.8 index 1cd2a0f..38586ca 100644 --- a/fuse/mount.exfat-fuse.8 +++ b/fuse/mount.exfat-fuse.8 @@ -81,6 +81,26 @@ Do not update access time when file is read. .SH EXIT CODES Zero is returned on successful mount. Any other code means an error. +.SH BUGS +exFAT is a case-insensitive file system. Some things can behave unexpectedly, +e.g. directory renaming that changes only case of some characters: + +.B \t$ mv FOO Foo +.br +.B \tmv: cannot move \(cqFOO\(cq to a subdirectory of itself, \(cqFoo/FOO\(cq + +This happens because +.B mv +finds that destination exists (for case-insensitive file +systems +.B FOO +and +.B Foo +are the same thing) and adds source basename to the destination. The file +system gets +.B rename(\(dqFOO\(dq,\ \(dqFoo/FOO\(dq) +syscall and returns an error. + .SH AUTHOR Andrew Nayenko diff --git a/libexfat/cluster.c b/libexfat/cluster.c index 523e9fb..fc3657b 100644 --- a/libexfat/cluster.c +++ b/libexfat/cluster.c @@ -149,10 +149,13 @@ static int flush_nodes(struct exfat* ef, struct exfat_node* node) return exfat_flush_node(ef, node); } -int exfat_flush(struct exfat* ef) +int exfat_flush_nodes(struct exfat* ef) { - int rc = flush_nodes(ef, ef->root); + return flush_nodes(ef, ef->root); +} +int exfat_flush(struct exfat* ef) +{ if (ef->cmap.dirty) { if (exfat_pwrite(ef->dev, ef->cmap.chunk, @@ -165,7 +168,7 @@ int exfat_flush(struct exfat* ef) ef->cmap.dirty = false; } - return rc; + return 0; } static bool set_next_cluster(const struct exfat* ef, bool contiguous, diff --git a/libexfat/exfat.h b/libexfat/exfat.h index 122ac5b..97d3692 100644 --- a/libexfat/exfat.h +++ b/libexfat/exfat.h @@ -169,6 +169,7 @@ cluster_t exfat_next_cluster(const struct exfat* ef, const struct exfat_node* node, cluster_t cluster); cluster_t exfat_advance_cluster(const struct exfat* ef, struct exfat_node* node, uint32_t count); +int exfat_flush_nodes(struct exfat* ef); int exfat_flush(struct exfat* ef); int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size, bool erase); diff --git a/libexfat/mount.c b/libexfat/mount.c index f1fb01a..0d6ce9e 100644 --- a/libexfat/mount.c +++ b/libexfat/mount.c @@ -359,7 +359,8 @@ static void finalize_super_block(struct exfat* ef) void exfat_unmount(struct exfat* ef) { - exfat_flush(ef); /* ignore return code */ + exfat_flush_nodes(ef); /* ignore return code */ + exfat_flush(ef); /* ignore return code */ exfat_put_node(ef, ef->root); exfat_reset_cache(ef); free(ef->root); diff --git a/libexfat/node.c b/libexfat/node.c index f3d10e0..d05f20d 100644 --- a/libexfat/node.c +++ b/libexfat/node.c @@ -664,7 +664,7 @@ int exfat_flush_node(struct exfat* ef, struct exfat_node* node) } node->flags &= ~EXFAT_ATTRIB_DIRTY; - return 0; + return exfat_flush(ef); } static bool erase_entry(struct exfat* ef, struct exfat_node* node) diff --git a/libexfat/platform.h b/libexfat/platform.h index eaa92f8..99fe507 100644 --- a/libexfat/platform.h +++ b/libexfat/platform.h @@ -24,7 +24,7 @@ #ifndef PLATFORM_H_INCLUDED #define PLATFORM_H_INCLUDED -#if defined(__linux__) +#if defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) #include #include