Message ID | 20180609123014.8861-10-ming.lei@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 DB562601F7 for <patchwork-linux-mm@patchwork.kernel.org>; Sat, 9 Jun 2018 12:32:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD6A1223A4 for <patchwork-linux-mm@patchwork.kernel.org>; Sat, 9 Jun 2018 12:32:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2310223A6; Sat, 9 Jun 2018 12:32:29 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63043223A4 for <patchwork-linux-mm@patchwork.kernel.org>; Sat, 9 Jun 2018 12:32:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 728366B0271; Sat, 9 Jun 2018 08:32:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6D5546B0273; Sat, 9 Jun 2018 08:32:28 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 577A56B0274; Sat, 9 Jun 2018 08:32:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 2B7CA6B0271 for <linux-mm@kvack.org>; Sat, 9 Jun 2018 08:32:28 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id c139-v6so15157691qkg.6 for <linux-mm@kvack.org>; Sat, 09 Jun 2018 05:32:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=QnymLwdG7ovrTOVELMTlHpWEzuGZyOESpKC4mPgtjHU=; b=j2eMtIhege/v8xM7Gh6WarD6jvYX2/5FSEpI1764MF7nsq7kCsXPX0aOkBPHAT8cqk pNLOJINciGZALaoBLs3m/yvHs36nIP+B0pn/zj3OoXJkx2H9AfXKUd2TZ8Mj1oEHSxt0 O1H84n2slO+CvMBxrXHUkCx+fIj9JftUJWv4b24mXUdphJDmppLs01qF7wHw30r0Aqrs mdRp0cK2RWFXf1CLbJzdAAq9pnw+eRJ9kGYUGyZQZIo2cqLRdyToc9DBJXY97W0wMnvg yyBDEW3shsTTSAR2JPCU5fi0SUACZs6NVFSQkEEhxGZA4+hf2LcoVilyATEEufgKIJ7V izUQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: APt69E152rdNExbOw6oklOx0bZ+GWUY9Wpwcd9/m59herKi+vh8mK99y bIOJs8X0EboLjzeYLUYf1ase2QHFWEfvQyj5j06p/rV5EjylwKMUWzpX/qfzvyuvvtLXZcD9CGh AaYQQ4FYPd2HqO/9zXTN9EGEWPgw0hAL3V+YcTnvyZh49SIMHN8AABCncKoLMbZWDqQ== X-Received: by 2002:ae9:e884:: with SMTP id a126-v6mr8794873qkg.161.1528547547988; Sat, 09 Jun 2018 05:32:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK48jBQQLqq5jE78omj90VEPiO1UiViVUX41YRGqBg2JLLpGv/fXTiu+0ycibf1E85fmtmm X-Received: by 2002:ae9:e884:: with SMTP id a126-v6mr8794848qkg.161.1528547547316; Sat, 09 Jun 2018 05:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528547547; cv=none; d=google.com; s=arc-20160816; b=stdO2F/aoF/4E58/u4BPviQYWz9L7E3Ibys5EmBvSewrWqph47yUj144FuLvSFNAK/ TCMuM6zPOGroL+V7rBdSpWSQi9hqq2cj+H2FeSMP6BCUAQQxr6gfp9OEHSdeBz5BFbZ7 WvoIzbzGb4BhW0CbVWLW0mWBTlaHvNiXjOH9fhA2byAaq0rM/kNLfg6ArUSR4ZfAip+C t44OzvV92LR5EQoFfyutOcS3bEzz+fQlp/tYaXMTEv+1G35ncBzZG0ag5q6dI5dtwTlL fSA0ERZ8Sj1GJsaKfvvYbXOHiaWWELJ+Hw33hPJeHPXKez62cjhPgov8O6n2raivovvy hJJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QnymLwdG7ovrTOVELMTlHpWEzuGZyOESpKC4mPgtjHU=; b=UOPB7IvlYhdX/KEHaZevBmDuTfgzMwGMhYtvOjmKrDaGdBrOvx888WymyTxaHMA3ld uwjuc9Du7IZEidipBduURzuL2w39z2BNjXd/2yIHV24NgaLi5KM5dC0cBw4aQ96FYiMl 1sKZxDXXWp2rCpdIOTmgsqWmGO+aiBRJcvv/vfybkmKL8hNsB3PwCRhi/T7ka1WBiPnJ Rrs0IC7nhfJKkX6sEgrCoeZ3Dh0dbRpU7CToTL4d13pijQETkyV/Qds+ss8nq7bpshbt 94/OIhbv/UgNxzYHZ+O2Rg603SIr5M5c8WARgev1p8g4jyY3n3J/YuMb1mEU/ao3nsWm TdmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id b37-v6si5476784qvb.173.2018.06.09.05.32.27 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 05:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5E68BB42D; Sat, 9 Jun 2018 12:32:26 +0000 (UTC) Received: from localhost (ovpn-12-40.pek2.redhat.com [10.72.12.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17F1342236; Sat, 9 Jun 2018 12:32:15 +0000 (UTC) From: Ming Lei <ming.lei@redhat.com> To: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@infradead.org>, Alexander Viro <viro@zeniv.linux.org.uk>, Kent Overstreet <kent.overstreet@gmail.com> Cc: David Sterba <dsterba@suse.cz>, Huang Ying <ying.huang@intel.com>, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o <tytso@mit.edu>, "Darrick J . Wong" <darrick.wong@oracle.com>, Coly Li <colyli@suse.de>, Filipe Manana <fdmanana@gmail.com>, Randy Dunlap <rdunlap@infradead.org>, Ming Lei <ming.lei@redhat.com> Subject: [PATCH V6 09/30] fs/buffer.c: use bvec iterator to truncate the bio Date: Sat, 9 Jun 2018 20:29:53 +0800 Message-Id: <20180609123014.8861-10-ming.lei@redhat.com> In-Reply-To: <20180609123014.8861-1-ming.lei@redhat.com> References: <20180609123014.8861-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Sat, 09 Jun 2018 12:32:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Sat, 09 Jun 2018 12:32:26 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/fs/buffer.c b/fs/buffer.c index cabc045f483d..630ae3e0238b 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3021,7 +3021,10 @@ void guard_bio_eod(int op, struct bio *bio) /* ..and clear the end of the buffer for reads */ if (op == REQ_OP_READ) { - zero_user(bvec->bv_page, bvec->bv_offset + bvec->bv_len, + struct bio_vec bv; + + chunk_last_segment(bvec, &bv); + zero_user(bv.bv_page, bv.bv_offset + bv.bv_len, truncated_bytes); } }
Once multipage bvec is enabled, the last bvec may include more than one page, this patch use chunk_last_segment() to truncate the bio. Signed-off-by: Ming Lei <ming.lei@redhat.com> --- fs/buffer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)