From patchwork Thu Jun 4 11:18:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: robbieko X-Patchwork-Id: 6546051 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9359CC0020 for ; Thu, 4 Jun 2015 11:28:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B735C205CB for ; Thu, 4 Jun 2015 11:28:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CECDF204CF for ; Thu, 4 Jun 2015 11:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753110AbbFDL2J (ORCPT ); Thu, 4 Jun 2015 07:28:09 -0400 Received: from mail.synology.com ([59.124.41.242]:31832 "EHLO mail.synology.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbbFDL1y (ORCPT ); Thu, 4 Jun 2015 07:27:54 -0400 Received: from localhost.localdomain (unknown [192.168.0.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: robbieko@synology.com) by mail.synology.com (Postfix) with ESMTPSA id A932A1DE6925; Thu, 4 Jun 2015 19:18:18 +0800 (CST) From: Robbie Ko To: linux-btrfs@vger.kernel.org Cc: Robbie Ko Subject: [PATCH 5/5] Btrfs: incremental send, fix rmdir not send utimes Date: Thu, 4 Jun 2015 19:18:10 +0800 Message-Id: <1433416690-19177-6-git-send-email-robbieko@synology.com> In-Reply-To: <1433416690-19177-1-git-send-email-robbieko@synology.com> References: <1433416690-19177-1-git-send-email-robbieko@synology.com> X-MailScanner-ID: A932A1DE6925.A8479 X-MailScanner: Found to be clean X-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (cached, score=2.55, required 8, ALL_TRUSTED -1.00, AWL 1.35, BAYES_05 -0.50, DNS_FROM_AHBL_RHSBL 2.70, URIBL_BLOCKED 0.00) X-MailScanner-From: robbieko@synology.com 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 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There's one case where we can't issue a utimes operation for a directory. When 263 will delete, waiting 261 and set 261 rmdir_ino, but 262 earlier processed and update uime between two parent directory. So fix this by not update non exist utimes for this case. Example: Parent snapshot: |---- a/ (ino 259) |---- c (ino 264) |---- b/ (ino 260) |---- d (ino 265) |---- del/ (ino 263) |---- item1/ (ino 261) |---- item2/ (ino 262) Send snapshot: |---- a/ (ino 259) |---- b/ (ino 260) |---- c/ (ino 2) |---- item2 (ino 259) |---- d/ (ino 257) |---- item1/ (ino 258) Signed-off-by: Robbie Ko --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index e8eb3ab..46f954c 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -2468,7 +2468,7 @@ verbose_printk("btrfs: send_utimes %llu\n", ino); key.type = BTRFS_INODE_ITEM_KEY; key.offset = 0; ret = btrfs_search_slot(NULL, sctx->send_root, &key, path, 0, 0); - if (ret < 0) + if (ret != 0) goto out; eb = path->nodes[0];