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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <x49ppevwdd7.fsf@segfault.boston.devel.redhat.com>
Date:	Tue, 16 Sep 2014 15:53:56 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Milosz Tanski <milosz@...in.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Christoph Hellwig <hch@...radead.org>,
	"linux-fsdevel\@vger.kernel.org" <linux-fsdevel@...r.kernel.org>,
	linux-aio@...ck.org, Mel Gorman <mgorman@...e.de>,
	Volker Lendecke <Volker.Lendecke@...net.de>,
	Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH 4/7] O_NONBLOCK flag for readv2/preadv2

Milosz Tanski <milosz@...in.com> writes:

>> Why did you put the wouldblock label inside the loop?  That should be
>> pushed down to just above out, and then you can get rid of the goto.
>
> When I put the code outside the loop it actually looked worse (imo):
>
> }
>
> goto out;
>
> would_block:
> error = -EAGAIN;
>
> out:
> ...
>

We don't exit the loop without a return or a goto, so you wouldn't need
that 'goto out' just below the end of the loop.  It would look like:

	}

would_block:
	error = -EAGAIN;
out:
...

> Point taken and I can fix this for the next version further up the
> stack. A longer term question is how the flags the file is open with
> interact with the read/write flags ... since I imagine folks will want
> to add other flags (like force a SYNC write).

I think we'll have to address those one at a time.  I do like the idea
of the SYNC flag for a write, though you'll probably have several
variants of that (equivalents of SYNC and DSYNC at least).  Another fun
write flag to consider is O_ATOMIC.  :)

Cheers,
Jeff
--
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