lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 8 Feb 2013 09:38:11 -0800
From:	Zach Brown <zab@...bo.net>
To:	Anatol Pomozov <anatol.pomozov@...il.com>
Cc:	linux-fsdevel@...r.kernel.org, Theodore Ts'o <tytso@....edu>,
	koverstreet@...gle.com, linux-aio@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: Improving AIO cancellation

> The draft implementation will look like this. struct bio should have
> some way to get current status of kiocb that generated bio. So we add
> a pointer to bool flag.
> 
> struct bio {
>   bool *cancelled;
> }
> 
> in async DIO codepath this pointer will be initialized with bool at
> "struct kiocb"
>   bio->cancelled = &kiocb->cancelled;

Hmm.  I suppose.  It sure looks disgusting, but the iocb has forgotten
all of the dio state and bios that lead up to the operation once
submission has completed.  It's easy enough to match the lifetime rules
of this reference with end_io's using the iocb.

This method also lets one cancelled iocb flag many submitted bios as
cancelled, so that's nice.

> So to cancel kiocb we do
> kiocb->cancelled = true;
> and all bio created from the request will not be send to device anymore.

(With lots of comments to let us know that it being racey is fine.)

> If the proposal is fine then I start implementing it.

For a teeny hack like this the best proposal is a working prototype
patch.  Don't wait for acks just dive in.

- 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ