From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755948AbcHXU1I (ORCPT ); Wed, 24 Aug 2016 16:27:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56283 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755921AbcHXU1F (ORCPT ); Wed, 24 Aug 2016 16:27:05 -0400 Date: Wed, 24 Aug 2016 16:17:01 -0400 From: Greg Kroah-Hartman To: Mark Hounschell Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Wim Osterholt , Jiri Kosina , Jens Axboe Subject: Re: [PATCH 4.7 146/186] floppy: fix open(O_ACCMODE) for ioctl-only open Message-ID: <20160824201701.GB2133@kroah.com> References: <20160818135932.219369981@linuxfoundation.org> <20160818135938.484441980@linuxfoundation.org> <0df64efc-85fe-1de7-f15f-233f1e5fdad8@compro.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0df64efc-85fe-1de7-f15f-233f1e5fdad8@compro.net> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 24, 2016 at 09:34:44AM -0400, Mark Hounschell wrote: > On 08/18/2016 09:59 AM, Greg Kroah-Hartman wrote: > > 4.7-stable review patch. If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Jiri Kosina > > > > commit ff06db1efb2ad6db06eb5b99b88a0c15a9cc9b0e upstream. > > > > Commit 09954bad4 ("floppy: refactor open() flags handling"), as a > > side-effect, causes open(/dev/fdX, O_ACCMODE) to fail. It turns out that > > this is being used setfdprm userspace for ioctl-only open(). > > > > Reintroduce back the original behavior wrt !(FMODE_READ|FMODE_WRITE) > > modes, while still keeping the original O_NDELAY bug fixed. > > > > Reported-by: Wim Osterholt > > Tested-by: Wim Osterholt > > Signed-off-by: Jiri Kosina > > Signed-off-by: Jens Axboe > > Signed-off-by: Greg Kroah-Hartman > > > > --- > > drivers/block/floppy.c | 21 +++++++++------------ > > 1 file changed, 9 insertions(+), 12 deletions(-) > > > > --- a/drivers/block/floppy.c > > +++ b/drivers/block/floppy.c > > @@ -3663,11 +3663,6 @@ static int floppy_open(struct block_devi > > > > opened_bdev[drive] = bdev; > > > > - if (!(mode & (FMODE_READ|FMODE_WRITE))) { > > - res = -EINVAL; > > - goto out; > > - } > > - > > res = -ENXIO; > > > > if (!floppy_track_buffer) { > > @@ -3711,13 +3706,15 @@ static int floppy_open(struct block_devi > > if (UFDCS->rawcmd == 1) > > UFDCS->rawcmd = 2; > > > > - UDRS->last_checked = 0; > > - clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags); > > - check_disk_change(bdev); > > - if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags)) > > - goto out; > > - if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags)) > > - goto out; > > + if (mode & (FMODE_READ|FMODE_WRITE)) { > > + UDRS->last_checked = 0; > > + clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags); > > + check_disk_change(bdev); > > + if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags)) > > + goto out; > > + if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags)) > > + goto out; > > + } > > > > res = -EROFS; > > > > > > > > > > I have a problem with this patch. It only fixes one of the regressions > caused by the original change to the floppy driver. It does not address the > user land breakage of removing the NODELAY flag checks. Does the same problem also happen in Linus's tree? If not, any hints on the patch that might have fixed it there? thanks, greg k-h