From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:35338 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965013AbcBQXP0 (ORCPT ); Wed, 17 Feb 2016 18:15:26 -0500 Date: Wed, 17 Feb 2016 23:15:24 +0000 From: Al Viro To: Martin Brandenburg Cc: Mike Marshall , Linus Torvalds , linux-fsdevel , Stephen Rothwell Subject: Re: Orangefs ABI documentation Message-ID: <20160217231524.GQ17997@ZenIV.linux.org.uk> References: <20160215184554.GY17997@ZenIV.linux.org.uk> <20160215230434.GZ17997@ZenIV.linux.org.uk> <20160216233609.GE17997@ZenIV.linux.org.uk> <20160216235441.GF17997@ZenIV.linux.org.uk> <20160217230900.GP17997@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217230900.GP17997@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Feb 17, 2016 at 11:09:00PM +0000, Al Viro wrote: > However, that doesn't prevent all unpleasantness here - giving up just as > it's being copied to userland and going into restart. Ho-hum... How about > the following: > * move increment of op->attempts into the same place where we > set "given up" > * in addition to the check for "given up" in the request-picking loop > (as above), fetch op->attempts before dropping op->lock > * after having retaken op->lock (after copy_to_user()) recheck > op->attempts instead of checking for "given up". Crap... There's a similar problem on the other end - in orangefs_devreq_write_iter() between the time when op has been fetched from the hash and the time we finish copying reply from userland. Same kind of "what it clear_... gets all way through and we resubmit it before we get around to checking the given_up flag" problem... Let me think a bit...