handle err_file_open on delete

if we get this error when we are trying to remove the file before
closing (ie windows doesn't allow removal of opened files), we
first send the close and then re-try the remove
This commit is contained in:
Olga Kornievskaia 2012-06-11 12:21:07 -04:00
parent 1d47cba1af
commit 19d813da6a

View file

@ -896,9 +896,17 @@ static int handle_close(nfs41_upcall *upcall)
OPEN_DELEGATE_WRITE, TRUE); OPEN_DELEGATE_WRITE, TRUE);
dprintf(1, "calling nfs41_remove for %s\n", name->name); dprintf(1, "calling nfs41_remove for %s\n", name->name);
retry_delete:
rm_status = nfs41_remove(state->session, &state->parent, rm_status = nfs41_remove(state->session, &state->parent,
name, state->file.fh.fileid); name, state->file.fh.fileid);
if (rm_status) { if (rm_status) {
if (rm_status == NFS4ERR_FILE_OPEN) {
status = do_nfs41_close(state);
if (!status) {
state->do_close = 0;
goto retry_delete;
} else goto out;
}
dprintf(1, "nfs41_remove() failed with error %s.\n", dprintf(1, "nfs41_remove() failed with error %s.\n",
nfs_error_string(rm_status)); nfs_error_string(rm_status));
rm_status = nfs_to_windows_error(rm_status, ERROR_INTERNAL_ERROR); rm_status = nfs_to_windows_error(rm_status, ERROR_INTERNAL_ERROR);