New commits:
commit d091ad070a0d251ca9d246d83be211fa004059e4
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
force single-threaded mode to fix multijob installs in rare cases
commit 1f8c749883414a50acabdc0e17fcf166f834a2a3
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
updated authors
commit ad8c929b839a32d08a8429c3c6575e9b97143a1d
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
use dynamic version info; updated configure template
commit ef3879dbef542b460111f1f371d554c7dca76ad8
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
do not modify command-line arguments directly in memory
commit 4af34740f4d7ae03af251cdbc8caf7465920f5b8
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
fixed possible race condition by removing of fgetattr call
commit a31e320474e7c1c81fe9d5b705b5156aa64f37f8
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
fixed the warning: implicit declaration of function
commit 56bc9f2f8f3b4c73ae862fb94ca80b47e3578017
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
added ability to use '-o debug' option
commit 45a8a07221303f11aa1f10a59d16aacf8531e78f
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
fixed warnings after compilation with -Wall flag
diff --git a/AUTHORS b/AUTHORS
index 0c9b948..ef52fdb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,19 +1,17 @@
-Current repo Admin:
- Elisamuel Resto
- <ryuji AT sourcemage.org>
-
Current Maintainer:
- Dale E. Edmons
- <linuxfan AT sourcemage.org>
+ Vlad Glagolev <stealth AT sourcemage.org>
-Tester and/or other lurkers:
- lynxlynxlynx AT mages.org
- flux_control AT sourcemage.org
+Testers and/or other lurkers:
+ Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ Justin Boffemmyer <flux AT sourcemage.org>
-------------------------------------------------
Please do not contact any of the following with questions on the
current development.
+Previous Maintainers:
+ Dale E. Edmons <linuxfan AT sourcemage.org>
+ Elisamuel Resto <ryuji AT sourcemage.org>
+
Original Author:
- David Brown
- <dmlb2000 AT gmail.com>
+ David Brown <dmlb2000 AT gmail.com>
diff --git a/ChangeLog b/ChangeLog
index 28a49b2..325a738 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2015-03-22 Vlad Glagolev <stealth AT sourcemage.org>
+ * configure.in: -> configure.ac; updated spell version to 0.6.2
+ * src/castfs.c: use dynamic version value; force single-threaded mode
+ to prevent race conditions in multijob (make -j N) installs (fuse is
+ thread-safe, but we need more investingation on how make and castfs
+ are for different filesystems
+ * AUTHORS: updated
+
+2015-03-21 Vlad Glagolev <stealth AT sourcemage.org>
+ * src/castfs.c: handle mkfifo/mknod return value; removed fgetattr
call
+ which can lead to race condition in some rare cases
+ (see http://marc.info/?l=linux-fsdevel&m=124442640826290&w=2); do
not
+ modify command-line arguments directly: this breaks them in a
process
+ tree
+ * src/utils.c: removed unused variable; added ability to use '-o
debug'
+ option
+ * include/castfs.h: declare stage_not_in_mnt()
+
2012-09-10 Vlad Glagolev <stealth AT sourcemage.org>
* src/castfs.c: fixed segfault, when running without any arguments
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..378e81d
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,46 @@
+AC_INIT(castfs, 0.6.2)
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+
+AM_MAINTAINER_MODE
+
+AC_ARG_ENABLE(debug,
+AC_HELP_STRING([--enable-debug],[Enable debug flags]),
+ [ CFLAGS="$CFLAGS -Wall -g" ],
+ [])
+
+AC_ARG_WITH(pkgconfigdir,
+AC_HELP_STRING([--with-pkgconfigdir=DIR],[pkgconfig file in DIR
@<:@LIBDIR/pkgconfig@:>@]),
+ [pkgconfigdir=$withval],
+ [pkgconfigdir='${libdir}/pkgconfig'])
+AC_SUBST(pkgconfigdir)
+
+CPPFLAGS="${CPPFLAGS} `pkg-config --cflags fuse` -D_REENTRANT
-DFUSE_USE_VERSION=25"
+
+AC_CHECK_HEADERS(fuse.h,, AC_MSG_ERROR([fuse 2.4 or newer is required to
build castfs]))
+
+AC_CHECK_LIB(fuse, fuse_main,, AC_MSG_ERROR([fuse 2.4 or newer is required
to build castfs]))
+
+FUSE_PREFIX=`pkg-config --variable=exec_prefix fuse `
+AC_SUBST(FUSE_PREFIX,PREFIX,DATAROOTDIR)
+
+AC_ARG_ENABLE(static-fuse,
+AC_HELP_STRING([--enable-static-fuse], [Enable building castfs against fuse
statically]),
+[static_fuse=${enableval}], [static_fuse=no])
+
+if test "x$static_fuse" = "xyes"
+then
+ LIBS=`pkg-config --libs fuse | sed
's/-lfuse/$(FUSE_PREFIX)\/lib\/libfuse.a -lrt/'`
+fi
+
+AC_CHECK_FUNCS([setxattr])
+
+AC_CONFIG_FILES([
+Makefile
+include/Makefile
+src/Makefile
+test/Makefile
+debian/Makefile
+include/config.h
+])
+AC_OUTPUT
diff --git a/configure.in b/configure.in
deleted file mode 100644
index 584190a..0000000
--- a/configure.in
+++ /dev/null
@@ -1,46 +0,0 @@
-AC_INIT(castfs, 0.5.1)
-AM_INIT_AUTOMAKE
-AC_PROG_CC
-
-AM_MAINTAINER_MODE
-
-AC_ARG_ENABLE(debug,
-AC_HELP_STRING([--enable-debug],[Enable debug flags]),
- [ CFLAGS="$CFLAGS -Wall -g" ],
- [])
-
-AC_ARG_WITH(pkgconfigdir,
-AC_HELP_STRING([--with-pkgconfigdir=DIR],[pkgconfig file in DIR
@<:@LIBDIR/pkgconfig@:>@]),
- [pkgconfigdir=$withval],
- [pkgconfigdir='${libdir}/pkgconfig'])
-AC_SUBST(pkgconfigdir)
-
-CPPFLAGS="${CPPFLAGS} `pkg-config --cflags fuse` -D_REENTRANT
-DFUSE_USE_VERSION=25"
-
-AC_CHECK_HEADERS(fuse.h,, AC_MSG_ERROR([fuse 2.4 or newer is required to
build castfs]))
-
-AC_CHECK_LIB(fuse, fuse_main,, AC_MSG_ERROR([fuse 2.4 or newer is required
to build castfs]))
-
-FUSE_PREFIX=`pkg-config --variable=exec_prefix fuse `
-AC_SUBST(FUSE_PREFIX,PREFIX,DATAROOTDIR)
-
-AC_ARG_ENABLE(static-fuse,
-AC_HELP_STRING([--enable-static-fuse], [Enable building castfs against fuse
statically]),
-[static_fuse=${enableval}], [static_fuse=no])
-
-if test "x$static_fuse" = "xyes"
-then
- LIBS=`pkg-config --libs fuse | sed
's/-lfuse/$(FUSE_PREFIX)\/lib\/libfuse.a -lrt/'`
-fi
-
-AC_CHECK_FUNCS([setxattr])
-
-AC_CONFIG_FILES([
-Makefile
-include/Makefile
-src/Makefile
-test/Makefile
-debian/Makefile
-include/config.h
-])
-AC_OUTPUT
diff --git a/include/castfs.h b/include/castfs.h
index 005eadf..758d9d1 100644
--- a/include/castfs.h
+++ b/include/castfs.h
@@ -50,6 +50,7 @@ int cast_copy_file(const char *from, const char *to);
int cast_paths_log(cast_paths_ptr paths);
int cast_mkdir_rec_staged(cast_paths_ptr dir);
int parse_mount_options(char *str);
+int stage_not_in_mnt(const char *mnt, const char *stage);
void strip_out_arguments(char *arg);
int shouldIgnore(const char *path);
diff --git a/src/castfs.c b/src/castfs.c
index 3211789..3d2dea8 100644
--- a/src/castfs.c
+++ b/src/castfs.c
@@ -25,32 +25,6 @@ static int cast_getattr(const char *path, struct stat
*stbuf)
return 0;
}
-/* shouldn't this be nearly identical to above? This won't stage, will it?
*/
-static int cast_fgetattr(const char *path, struct stat *stbuf,
- struct fuse_file_info *fi)
-{
-//fprintf(stderr, "cast_fgetattr: %s\n", path);
- int res;
- cast_log(CAST_DBG_SYS, "fgetattr %s\n", path);
-#if 1 // 0=old behavior; 1=new behavior
- char *cpath = strdup(path);
- cast_paths_ptr paths = castHashGetValueOf(cpath);
-
- cast_log(CAST_DBG_SYS, "\tfgetattr %s\n", cpath);
- cast_paths_log(paths);
- if (paths && paths->is_staged)
- res = lstat(paths->stage_path, stbuf);
- // Not sure this is correct, but I think it is! --D.E.
- else
- //res = fstat(cpath, stbuf);
-#endif
- res = fstat(fi->fh, stbuf);
- if (res == -1)
- return -errno;
-
- return 0;
-}
-
static int cast_access(const char *path, int mask)
{
//fprintf(stderr, "cast_access: %s\n", path);
@@ -192,6 +166,10 @@ static int cast_mknod(const char *path, mode_t mode,
dev_t rdev)
res = mkfifo(paths->stage_path, mode);
else
res = mknod(paths->stage_path, mode, rdev);
+
+ if (res == -1)
+ return -errno;
+
paths->is_staged = 1;
paths->is_deleted = 0;
return 0;
@@ -684,7 +662,6 @@ static int cast_releasedir(const char *path, struct
fuse_file_info *fi)