On Wed, Sep 07, 2005 at 12:03:50PM +0400, Evgeniy Polyakov ([EMAIL PROTECTED])
wrote:
> On Wed, Sep 07, 2005 at 11:57:08AM +0400, Evgeniy Polyakov ([EMAIL
> PROTECTED]) wrote:
> > On Wed, Sep 07, 2005 at 10:44:01AM +0300, Ronen Shitrit ([EMAIL PROTECTED])
> > wrote:
> > > Hi
> > >
> > > I don't think there is any problem to let the read request to flow
> > > through, since in the original code,
> > > In order to decrypt the read requests, we create a new task (workingQ)
> > > that perform the decrypt, and
> > > doesn't notify any other task when it finish, except for the
> > > dec_pending(io,r) which I moved to the read callback.
> >
> > No, dm-crypt only calls dec_pending() with BIO with decrypted data,
> > but with your code it can be called before read callback is invoked
> > and even before BIO is touched in crypto code.
>
> I mean following code:
+ crp->crp_sid = cc->ocf_cryptoid;
+ if(crypto_dispatch(crp) != 0) {
+ printk("dm_ocf_process: crypto_dispatch failed!!\n");
+ }
+
+ return 0;
+
+}
> +#if defined(CONFIG_OCF_DM_CRYPT)
> + r = ocf_crypt_convert(cc, &ctx, io);
> +
> + if(r < 0)
> + dec_pending(io, r);
> +#else
So it will process BIO as error, while crypto code did not even touch
it.
And btw, you do not check kmalloc() result in ocf_crypt_convert(),
you need __GFP_NOFAIL bit set to guarantee successfull allocation.
--
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html