From patchwork Mon Sep 30 18:55:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11167157 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 5A8AA912 for ; Mon, 30 Sep 2019 19:00:54 +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 41BF8224EF for ; Mon, 30 Sep 2019 19:00:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41BF8224EF 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 EE73B5C40B8; Mon, 30 Sep 2019 11:58:46 -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 21BE65C344D for ; Mon, 30 Sep 2019 11:57:14 -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 C424C1005643; Mon, 30 Sep 2019 14:56:56 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id C1EFDB5; Mon, 30 Sep 2019 14:56:56 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 30 Sep 2019 14:55:09 -0400 Message-Id: <1569869810-23848-51-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1569869810-23848-1-git-send-email-jsimmons@infradead.org> References: <1569869810-23848-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 050/151] lustre: lov: add Data-on-MDT tests and fixes 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: Mikhal Pershin , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Mikhal Pershin - fixes for DoM code for issues revealed by tests. WC-bug-id: https://jira.whamcloud.com/browse/LU-3285 Lustre-commit: a7625cd2f37a ("LU-3285 test: add Data-on-MDT tests and fixes") Signed-off-by: Mikhal Pershin Reviewed-on: https://review.whamcloud.com/28020 Reviewed-by: Jinshan Xiong Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- fs/lustre/lov/lov_object.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fs/lustre/lov/lov_object.c b/fs/lustre/lov/lov_object.c index 186b875..34575dc 100644 --- a/fs/lustre/lov/lov_object.c +++ b/fs/lustre/lov/lov_object.c @@ -431,8 +431,17 @@ static int lov_attr_get_dom(const struct lu_env *env, struct lov_object *lov, return OST_LVB_GET_ERR(loi->loi_lvb.lvb_blocks); cl_lvb2attr(attr, &loi->loi_lvb); - attr->cat_kms = attr->cat_size > loi->loi_kms ? attr->cat_size : - loi->loi_kms; + + /* DoM component size can be bigger than stripe size after + * client's setattr RPC, so do not count anything beyound + * component end. Alternatively, check that limit on server + * and do not allow size overflow there. + */ + if (attr->cat_size > lle->lle_extent.e_end) + attr->cat_size = lle->lle_extent.e_end; + + attr->cat_kms = attr->cat_size; + dom->lo_dom_r0.lo_attr_valid = 1; *lov_attr = attr; @@ -508,7 +517,6 @@ static int lov_init_dom(const struct lu_env *env, struct lov_device *dev, struct cl_device *mdcdev; struct lov_oinfo *loi = NULL; struct cl_object_conf *sconf = <i->lti_stripe_conf; - struct inode *inode = conf->coc_inode; u32 idx = 0; int rc; @@ -538,15 +546,6 @@ static int lov_init_dom(const struct lu_env *env, struct lov_device *dev, return -ENOMEM; fid_to_ostid(lu_object_fid(lov2lu(lov)), &loi->loi_oi); - /* Initialize lvb structure */ - loi->loi_lvb.lvb_mtime = inode->i_mtime.tv_sec; - loi->loi_lvb.lvb_atime = inode->i_atime.tv_sec; - loi->loi_lvb.lvb_ctime = inode->i_ctime.tv_sec; - loi->loi_lvb.lvb_blocks = inode->i_blocks; - loi->loi_lvb.lvb_size = i_size_read(inode); - if (loi->loi_lvb.lvb_size > lsme->lsme_stripe_size) - loi->loi_lvb.lvb_size = lsme->lsme_stripe_size; - loi_kms_set(loi, loi->loi_lvb.lvb_size); sconf->u.coc_oinfo = loi; again: @@ -843,6 +842,12 @@ static int lov_attr_get_composite(const struct lu_env *env, if (!lov_attr) continue; + CDEBUG(D_INODE, + "COMP ID #%i: s=%llu m=%llu a=%llu c=%llu b=%llu\n", + index - 1, lov_attr->cat_size, + lov_attr->cat_mtime, lov_attr->cat_atime, + lov_attr->cat_ctime, lov_attr->cat_blocks); + /* merge results */ attr->cat_blocks += lov_attr->cat_blocks; if (attr->cat_size < lov_attr->cat_size)