[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete
From: |
Bandan Das |
Subject: |
Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete |
Date: |
Mon, 11 Mar 2019 14:11:09 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Peter Maydell <address@hidden> writes:
...
>> >
>> >> > It might be useful to take a step back -- what are
>> >> > the different possible outcomes from this function that
>> >> > we need to distinguish, and when should we be returning
>> >> > which outcome?
>> >
>> They are what the variable names signify.
>
> That doesn't get me any further forward, I'm afraid.
>
> Looking at the code, we seem to have:
> * for any particular node, either we can delete it
> or we can't
> * we also iterate through each child node recursively
>
> So we have to combine together the "deleted this"
> and "failed to delete this" information for the whole tree.
> In which conditions should we end up with which RES_*
> result code? It seems plausible that we want RES_OK
> only if every deletion attempt in the tree succeeded.
> But what about the others? Is it supposed to be
> RES_PARTIAL_DELETE if some deletions succeeded and
> some failed, and RES_STORE_READ_ONLY if every single
> deletion failed ?
>
Ok, this is easier. Now, I know what you are referring to
instead of guessing what and how I should be explainng.
What you said is essentially correct. When deleting a
single object that's a file, the return value would either
be OK or STORE_READ_ONLY.
When deleting an object which is a folder, Qemu goes through
its contents. If it succeeds in deleting all the content objects,
the result is success. If one or some objects couldn't be deleted for
whatever reason, the result is RES_PARTIAL_DELETE and if none
of the objects could be deleted, Qemu returns a READ_ONLY.
In usb_mtp_object_delete(), based on the return value of this
function, we set s->result appropriately.
> thanks
> -- PMM
- Re: [Qemu-devel] [PULL 3/4] usb-mtp: prevent null dereference while deleting objects, (continued)
- Re: [Qemu-devel] [PULL 3/4] usb-mtp: prevent null dereference while deleting objects, Peter Maydell, 2019/03/08
- Re: [Qemu-devel] [PULL 3/4] usb-mtp: prevent null dereference while deleting objects, Bandan Das, 2019/03/08
- [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Bandan Das, 2019/03/08
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Peter Maydell, 2019/03/09
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Bandan Das, 2019/03/11
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Peter Maydell, 2019/03/11
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Bandan Das, 2019/03/11
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Peter Maydell, 2019/03/11
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Bandan Das, 2019/03/11
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Peter Maydell, 2019/03/11
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete,
Bandan Das <=
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Peter Maydell, 2019/03/11
- Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete, Bandan Das, 2019/03/11
- Re: [Qemu-devel] [PULL 3/4] usb-mtp: prevent null dereference while deleting objects, Peter Maydell, 2019/03/09
Re: [Qemu-devel] [PULL 0/4] Usb 20190307 patches, Peter Maydell, 2019/03/07