From patchwork Thu Jun 1 17:52:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Derrick X-Patchwork-Id: 9790365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7BFFB60325 for ; Thu, 15 Jun 2017 22:53:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6393228066 for ; Thu, 15 Jun 2017 22:53:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55A86283E8; Thu, 15 Jun 2017 22:53:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=2.0 tests=BAYES_00, DATE_IN_PAST_96_XX, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FBAB28066 for ; Thu, 15 Jun 2017 22:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751141AbdFOWxo (ORCPT ); Thu, 15 Jun 2017 18:53:44 -0400 Received: from mga05.intel.com ([192.55.52.43]:20186 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbdFOWxn (ORCPT ); Thu, 15 Jun 2017 18:53:43 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 15 Jun 2017 15:53:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,345,1493708400"; d="scan'208";a="1183099021" Received: from jderrick-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.232.112.201]) by fmsmga002.fm.intel.com with ESMTP; 15 Jun 2017 15:53:41 -0700 Subject: Re: RFC: pwritev2 regression test for invalid flags To: Adhemerval Zanella , GNU C Library , Christoph Hellwig Cc: Stephen Bates , "linux-block@vger.kernel.org" , Christoph Hellwig , Jens Axboe References: From: Jon Derrick Message-ID: <43631a74-8934-6940-3eaa-e562e49c5cb2@intel.com> Date: Thu, 1 Jun 2017 11:52:25 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Zanella, On 06/15/2017 04:10 PM, Adhemerval Zanella wrote: > After the issue with LO_HI_LONG definition on x86_64-linux-gnu, I planed to add > this patch to check the above patch for correct check for invalid flags (which > would also have show this issue with LO_HI_LONG being used on p{read,write}v2). > > However it seems to trigger what I think it is a kernel bug on version that > provides p{read,write}v, where preadv2 does fails with EOPNOTSUPP but > pwritev2 does not. For instance, on x86_64-linux-gnu-x32 and i686-linux-gnu > (4.10.0-21-generic/x86_64): It looks like the issue is that you are going through the compat_writev path, which for some reason discards the flags parameter. Can you apply the patch below to your kernel? diff --git a/fs/read_write.c b/fs/read_write.c index c4f88af..f77eb22 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1210,7 +1210,7 @@ static size_t compat_writev(struct file *file, if (!(file->f_mode & FMODE_CAN_WRITE)) goto out; - ret = compat_do_readv_writev(WRITE, file, vec, vlen, pos, 0); + ret = compat_do_readv_writev(WRITE, file, vec, vlen, pos, flags); out: if (ret > 0)