Commit e58c31a8 authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Inform FUSE that we wrap and thus accept the UTIME_OMIT (and UTIME_NOW) magic...

Inform FUSE that we wrap and thus accept the UTIME_OMIT (and UTIME_NOW) magic values to ensure that "touch -m …" and "touch -a …" work as expected. (Closes: #911281)
parent 80402ea8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -293,6 +293,12 @@ int main (int argc, char** argv)
	 * Initialize disorderfs_fuse_operations
	 */

	/*
	 * Indicate that we should accept UTIME_OMIT (and UTIME_NOW) in the
	 * utimens operations for "touch -m" and "touch -a"
	 */
	disorderfs_fuse_operations.flag_utime_omit_ok = 1;

	disorderfs_fuse_operations.getattr = [] (const char* path, struct stat* st) -> int {
		Guard g;
		if (lstat((root + path).c_str(), st) == -1) {
+0 −4
Original line number Diff line number Diff line
@@ -19,10 +19,6 @@ Fail () {
	exit 1
}

XFail () {
	echo "XFail: ${*}"
}

Expect () {
	ENTRIES="$(Get_entries)"
	EXPECTED="${1}"
+4 −8
Original line number Diff line number Diff line
@@ -20,21 +20,17 @@ fi
touch ${FILENAME}
touch -m -d @${EXPECTED} ${FILENAME}
RESULT="$(stat --format=%Y ${FILENAME})"
if [ "${RESULT}" = "${EXPECTED}" ]
if [ "${RESULT}" != "${EXPECTED}" ]
then
	Fail "test2: Did not XFail"
else
	XFail "test2: Got=${RESULT} Expected=${EXPECTED}"
	Fail "test2: Got=${RESULT} Expected=${EXPECTED}"
fi

touch ${FILENAME}
touch -a -d @${EXPECTED} ${FILENAME}
RESULT="$(stat --format=%X ${FILENAME})"
if [ "${RESULT}" = "${EXPECTED}" ]
if [ "${RESULT}" != "${EXPECTED}" ]
then
	Fail "test3: Did not XFail"
else
	XFail "test3: Got=${RESULT} Expected=${EXPECTED}"
	Fail "test3: Got=${RESULT} Expected=${EXPECTED}"
fi

Unmount