From patchwork Wed May 23 15:58:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10421859 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 E27DB6053B for ; Wed, 23 May 2018 15:58:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEDCE28C49 for ; Wed, 23 May 2018 15:58:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C37D429062; Wed, 23 May 2018 15:58: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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 5B62E28C49 for ; Wed, 23 May 2018 15:58:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754675AbeEWP6o (ORCPT ); Wed, 23 May 2018 11:58:44 -0400 Received: from mail-qt0-f175.google.com ([209.85.216.175]:36199 "EHLO mail-qt0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754671AbeEWP6m (ORCPT ); Wed, 23 May 2018 11:58:42 -0400 Received: by mail-qt0-f175.google.com with SMTP id q6-v6so28722884qtn.3 for ; Wed, 23 May 2018 08:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1CUCLN+ox6YKRueU27lA7S8vQE3MZ2D794WwOHBnCgI=; b=GAZfXgEt43olIYdGXdn5FDSauJuMJIx6K3CuRpSX8/XZnc3K8IrKVcsKn5l6XXZhy/ uaO2MAn147rkeRxrFiCEHelMi4vB3qVoFn5wsBgM/v4xKMBXizcU/zucTg3kkh8fPPSk l2jp1xQzPZwhUP8fhjFI7Xumn7RjiJLG5lK9fgMKKTWE4Uke1iXHA8jdkut4mecZ4ENw 52YtfP/VNDYCRsycydOgOgdY+LL4GDCBSoZun+udXJwrl/rLgCoG4Z3LMYJgXeuq1MUm 39J95IM7KRYiO3o5v+xk/IViP7dI6z1JKw+fR3jRZUzU2AmDmzCE+vS3bWFmdjfdUpkZ zasQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1CUCLN+ox6YKRueU27lA7S8vQE3MZ2D794WwOHBnCgI=; b=fzgGxHEX0byZJbdrfOdpP7Q7gTT+sPgd7mQ0hMCyAeIiADXz3ko1VeUp/5g3iOETKo 9kcT4MbTFA6v1cUyVeD9OXiz6JT5hllW63eO3qRd1Fzf0FViFxNYBwPR5A7PPTPrNjDP idtJGKcigXjmfpPQTXLfsKo7I3Ix1vxhGTg/PhCFv1fgbUHoovoTjksR/r7vm4Ukyxr2 ASWbQykMqa8fAZce8DwmPYeLoSsuVjNEqj/0AysCDo4divJYd3p/QtV2IOyK8sv3vzSe fk0o/oQgFjqrWVVqsMVAmZ7si+eJHVW7aH94rnGdZUnEmSZ8SdKatlHurKlSqsLE4OcF ptRw== X-Gm-Message-State: ALKqPwdpUYJ0oAO87KUaU91SazoMwnr+r2n+HmNjIW/jf6vmXo7USakM /xPSfS6F4oUCfAgSKLARpC5zqQPesd8= X-Google-Smtp-Source: AB8JxZpvV+gv/uck46gQ1cjpydu742PSH44Igx7R/d4Xa0QcYFAc+JrVKUYh7+HZ51nGzrY7OMx2lA== X-Received: by 2002:a0c:9481:: with SMTP id j1-v6mr2989262qvj.189.1527091121467; Wed, 23 May 2018 08:58:41 -0700 (PDT) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id q33-v6sm15967261qkq.72.2018.05.23.08.58.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 08:58:40 -0700 (PDT) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Cc: Josef Bacik Subject: [PATCH 3/4] btrfs: clean up the left over logged_list usage Date: Wed, 23 May 2018 11:58:35 -0400 Message-Id: <20180523155836.4622-3-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180523155836.4622-1-josef@toxicpanda.com> References: <20180523155836.4622-1-josef@toxicpanda.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Bacik We no longer use this list we've passed around so remove it everywhere. Also remove the extra checks for ordered/filemap errors as this is handled higher up now that we're waiting on ordered_extents before getting to the tree log code. Signed-off-by: Josef Bacik --- fs/btrfs/tree-log.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 791b5a731456..ef1b1a071bba 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4133,7 +4133,6 @@ static int log_one_extent(struct btrfs_trans_handle *trans, struct btrfs_inode *inode, struct btrfs_root *root, const struct extent_map *em, struct btrfs_path *path, - const struct list_head *logged_list, struct btrfs_log_ctx *ctx) { struct btrfs_root *log = root->log_root; @@ -4145,17 +4144,11 @@ static int log_one_extent(struct btrfs_trans_handle *trans, u64 block_len; int ret; int extent_inserted = 0; - bool ordered_io_err = false; ret = log_extent_csums(trans, inode, root, em); if (ret) return ret; - if (ordered_io_err) { - ctx->io_err = -EIO; - return ctx->io_err; - } - btrfs_init_map_token(&token); ret = __btrfs_drop_extents(trans, log, &inode->vfs_inode, path, em->start, @@ -4226,7 +4219,6 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_inode *inode, struct btrfs_path *path, - struct list_head *logged_list, struct btrfs_log_ctx *ctx, const u64 start, const u64 end) @@ -4302,20 +4294,6 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, } list_sort(NULL, &extents, extent_cmp); - btrfs_get_logged_extents(inode, logged_list, logged_start, logged_end); - /* - * Some ordered extents started by fsync might have completed - * before we could collect them into the list logged_list, which - * means they're gone, not in our logged_list nor in the inode's - * ordered tree. We want the application/user space to know an - * error happened while attempting to persist file data so that - * it can take proper action. If such error happened, we leave - * without writing to the log tree and the fsync must report the - * file data write error and not commit the current transaction. - */ - ret = filemap_check_errors(inode->vfs_inode.i_mapping); - if (ret) - ctx->io_err = ret; process: while (!list_empty(&extents)) { em = list_entry(extents.next, struct extent_map, list); @@ -4334,8 +4312,7 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, write_unlock(&tree->lock); - ret = log_one_extent(trans, inode, root, em, path, logged_list, - ctx); + ret = log_one_extent(trans, inode, root, em, path, ctx); write_lock(&tree->lock); clear_em_logging(tree, em); free_extent_map(em); @@ -4717,7 +4694,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, struct btrfs_key min_key; struct btrfs_key max_key; struct btrfs_root *log = root->log_root; - LIST_HEAD(logged_list); u64 last_extent = 0; int err = 0; int ret; @@ -5047,7 +5023,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, } if (fast_search) { ret = btrfs_log_changed_extents(trans, root, inode, dst_path, - &logged_list, ctx, start, end); + ctx, start, end); if (ret) { err = ret; goto out_unlock; @@ -5098,10 +5074,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, inode->last_log_commit = inode->last_sub_trans; spin_unlock(&inode->lock); out_unlock: - if (unlikely(err)) - btrfs_put_logged_extents(&logged_list); - else - btrfs_submit_logged_extents(&logged_list, log); mutex_unlock(&inode->log_mutex); btrfs_free_path(path);