From patchwork Tue Aug 11 12:19:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11709163 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACA4614E3 for ; Tue, 11 Aug 2020 12:20:24 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9361520578 for ; Tue, 11 Aug 2020 12:20:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9361520578 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id D2FC421F236; Tue, 11 Aug 2020 05:20:23 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 46F6221F157 for ; Tue, 11 Aug 2020 05:20:22 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id EA96310055E0; Tue, 11 Aug 2020 08:20:20 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id DEED22AC; Tue, 11 Aug 2020 08:20:20 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Tue, 11 Aug 2020 08:19:57 -0400 Message-Id: <1597148419-20629-2-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1597148419-20629-1-git-send-email-jsimmons@infradead.org> References: <1597148419-20629-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 01/23] lustre: lov: one more fix to write_intent end for trunc X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Bobi Jam This patch fixes another case where the truncate write intent extent is set incorrectly. This may cause errors when truncating PFL files to exactly the boundary between two extents. Fixes: 782b737b76c1 ("lustre: lov: Correct write_intent end for trunc") WC-bug-id: https://jira.whamcloud.com/browse/LU-12586 Lustre-commit: ecf9e229cf59d ("LU-12586 lov: one more fix to write_intent end for trunc") Signed-off-by: Bobi Jam Reviewed-on: https://review.whamcloud.com/38412 Reviewed-by: Wang Shilong Reviewed-by: Li Dongyang Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- fs/lustre/lov/lov_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c index 99b68d8..af79d20 100644 --- a/fs/lustre/lov/lov_io.c +++ b/fs/lustre/lov/lov_io.c @@ -363,11 +363,12 @@ static int lov_io_mirror_init(struct lov_io *lio, struct lov_object *obj, /** * for truncate, we uses [size, EOF) to judge whether * a write intent needs to be send, but we need to - * restore the write extent to [0, size). + * restore the write extent to [0, size), in truncate, + * the byte in the size position is accessed. */ io->ci_write_intent.e_start = 0; io->ci_write_intent.e_end = - io->u.ci_setattr.sa_attr.lvb_size; + io->u.ci_setattr.sa_attr.lvb_size + 1; } /* stop cl_io_init() loop */ return 1;