Apparent race condition w/ NFSv3 mktemp+write+rename

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Howdy. With a very heavily loaded (CentOS 5 - Linux 2.6.18-128.el5) NFSv3 client and server, I've experienced the following sporadic issue:

function atomic_write() {
    local filename="$1"
    local tempfile
    tempfile="$(mktemp "${filename}.XXXXXX")"
    cat >"${tempfile}" && mv "${tempfile}" "${filename}"
}

$ atomic_write /mnt/foobar <<<"baz"
mv: cannot move `/mnt/foobar.gO1881' to `/mnt/foobar': No such file or directory

Are my assumptions regarding available semantics fair and reasonable?

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux