[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121129000753.GG18574@lenny.home.zabbo.net>
Date: Wed, 28 Nov 2012 16:07:53 -0800
From: Zach Brown <zab@...hat.com>
To: Kent Overstreet <koverstreet@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-aio@...ck.org,
linux-fsdevel@...r.kernel.org, bcrl@...ck.org, jmoyer@...hat.com,
axboe@...nel.dk, viro@...iv.linux.org.uk
Subject: Re: [PATCH 07/25] aio: kiocb_cancel()
On Wed, Nov 28, 2012 at 08:43:31AM -0800, Kent Overstreet wrote:
> Minor refactoring, to get rid of some duplicated code
A minor nit:
> spin_lock_irq(&ctx->ctx_lock);
> - ret = -EAGAIN;
> +
> kiocb = lookup_kiocb(ctx, iocb, key);
> - if (kiocb && kiocb->ki_cancel) {
> - cancel = kiocb->ki_cancel;
> - kiocb->ki_users ++;
> - kiocbSetCancelled(kiocb);
> - } else
> - cancel = NULL;
...
> - if (NULL != cancel) {
> - } else
> - ret = -EINVAL;
In the old code it'd return -EINVAL for a NULL kiocb, despite that
misleading unused EAGAIN.
> + if (kiocb)
> + ret = kiocb_cancel(ctx, kiocb, &res);
> + else
> + ret = -EAGAIN;
But now it returns -EAGAIN.
I bet we want to err on the side of caution and maintain behaviour, no
matter how funky.
- z
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists