Branch: Tag:

2018-03-28

2018-03-28 10:23:32 by Henrik Grubbström (Grubba) <grubba@grubba.org>

WebDAV: Moved responsibility for implicit DELETE unlock.

To make sure that only the correct locks are implicitly unlocked
on partially failed DELETE, it is now the responsibility of the
respective location modules to perform the unlocking.

629:    } else {    deletes++;    +  unlock_path(virt_fname, id); +     if (id->misc->quota_obj && stat->isreg()) {    id->misc->quota_obj->deallocate(virt_fname,    stat->size());
1591:    TRACE_LEAVE("DELETE: Partial failure.");    return ([]);    } +  } else { +  unlock_path(f, id);    }    } else {    mapping|int(0..1) res =
1623:    privs = 0;    deletes++;    +  unlock_path(f, id); +     if (id->misc->quota_obj && (size > 0)) {    id->misc->quota_obj->deallocate(URI, size);    }
1708:    TRACE_LEAVE("");    return ([]);    } +  } else { +  unlock_path(dest, id);    }    SIMPLE_TRACE_LEAVE("COPY: Delete ok.");    } else if (source_st->isdir) {
1725:    SIMPLE_TRACE_LEAVE("COPY: File deletion failed (destination disappeared).");    } else {    SIMPLE_TRACE_LEAVE("COPY: File deletion ok."); +  +  unlock_path(dest, id);    }    } else {    SIMPLE_TRACE_LEAVE("COPY: No need to perform deletion.");