[Sheepdog] [PATCH] sheep: avoid calling get_vnode_info() against force operations
Liu Yuan
namei.unix at gmail.com
Sat May 5 12:13:23 CEST 2012
On 05/05/2012 06:08 PM, Christoph Hellwig wrote:
> On Sat, May 05, 2012 at 06:05:54PM +0800, Liu Yuan wrote:
>>> if (is_io_op(req->op)) {
>>> req->work.fn = do_io_request;
>>> req->work.done = io_op_done;
>>
>>
>>
>> Well, on the second look, free_request() calls put_vnode_info()... it
>> seems that we have to call get_vnode_info() for every request queuing, no?
>
> It checks for it beeing non-NULL first, and thus is fine.
>
> That beeing said I generally prefer the checks outside as they force
> a programming style that forces understanding what's going on.
>
It seems with this pathc, we don't get_vnode_info() for force-requests
and always put_vnode_info() after freeing req?
Doesn't it put current_vnode_info into a very dangerous state (for e.g,
it might be NULL when some other tries to get it) ?
Thanks,
Yuan
More information about the sheepdog
mailing list