From patchwork Mon Dec 15 05:26:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 5490531 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E07A1BEEA8 for ; Mon, 15 Dec 2014 05:29:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14CDB209E7 for ; Mon, 15 Dec 2014 05:29:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CC1F209E5 for ; Mon, 15 Dec 2014 05:29:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751460AbaLOF1n (ORCPT ); Mon, 15 Dec 2014 00:27:43 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:59381 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751246AbaLOF1a (ORCPT ); Mon, 15 Dec 2014 00:27:30 -0500 Received: by mail-pd0-f169.google.com with SMTP id z10so11037200pdj.0 for ; Sun, 14 Dec 2014 21:27:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=SrK97A5rmKL+cbv0p63GeKCRO5epFeLj09h3v1NGn28=; b=Y1AExAefbP0BS0URn1hE4a7MfUMjPLui7aBE0d4wDBXkmDZN0+uCym9SeXhboVOqG4 7Wk0AWzdY4fzN3L1W6X8HaANM7Ev+hfB0dw6iSOZRI7bFYLDKVPpsLNaw5XBA2MvppPc tBAa2SflFGKuJRMNlF8h/5wAJIKCeXvHS4+RnPIWgvPTETlG8UU+CewukO9QpLyUmFsD ql2ngM+1808yTBkId9UfpI2ugEpBBleYaqGsTN0CYdF1mSnor6HkkSuN7D9f5H8CcnaY 3Fqkya6ZYnke0KDgjAES+7b9sZJ+fzeNX94n5B7ELUw182G1IwBzbXHtvYX8nTBbCFkw CHFg== X-Gm-Message-State: ALoCoQmS7D+wDcB1sS717MPuO2cF3vPyDpb6rRkjnOzhHj2vwwcaQuMYkgU7DfIzVD0WqBnAczfW X-Received: by 10.68.213.138 with SMTP id ns10mr47670329pbc.50.1418621249664; Sun, 14 Dec 2014 21:27:29 -0800 (PST) Received: from mew.localdomain ([72.192.100.38]) by mx.google.com with ESMTPSA id f12sm7915174pdm.90.2014.12.14.21.27.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Dec 2014 21:27:28 -0800 (PST) From: Omar Sandoval To: Alexander Viro , Andrew Morton , Trond Myklebust , Christoph Hellwig , David Sterba , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Omar Sandoval Subject: [PATCH 3/8] swap: don't add ITER_BVEC flag to direct_IO rw Date: Sun, 14 Dec 2014 21:26:57 -0800 Message-Id: <5f9e8a7dcdf08bd2dd433f1a42690ab8e67e7915.1418618044.git.osandov@osandov.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The rw argument to direct_IO has some ill-defined semantics. Some filesystems (e.g., ext4, FAT) decide whether they're doing a write with rw == WRITE, but others (e.g., XFS) check rw & WRITE. Let's set a good example in the swap file code and say ITER_BVEC belongs in iov_iter->flags but not in rw. This caters to the least common denominator and avoids a sweeping change of every direct_IO implementation for now. Signed-off-by: Omar Sandoval --- mm/page_io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 1630ac0..c229f88 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -285,8 +285,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, set_page_writeback(page); unlock_page(page); mutex_lock(&inode->i_mutex); - ret = mapping->a_ops->direct_IO(ITER_BVEC | WRITE, - &kiocb, &from, + ret = mapping->a_ops->direct_IO(WRITE, &kiocb, &from, kiocb.ki_pos); mutex_unlock(&inode->i_mutex); if (ret == PAGE_SIZE) {