In vn_open(), if fstat64() returned an error, the real errno was being obscured by calling close(). Add error handling for both pwrite64() calls in vn_rdwr().