From patchwork Fri Jul 21 17:29:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9857447 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 722A7600F5 for ; Fri, 21 Jul 2017 17:30:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 597AB28684 for ; Fri, 21 Jul 2017 17:30:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E926286A2; Fri, 21 Jul 2017 17:30:53 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 013C028684 for ; Fri, 21 Jul 2017 17:30:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754665AbdGUR3k (ORCPT ); Fri, 21 Jul 2017 13:29:40 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:34750 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754562AbdGUR3O (ORCPT ); Fri, 21 Jul 2017 13:29:14 -0400 Received: by mail-qt0-f193.google.com with SMTP id o3so3120338qto.1 for ; Fri, 21 Jul 2017 10:29:14 -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=Zs06Eq8Cn4syq3obXYkuMUGT6x0Wvcns6Q07jzkmwwE=; b=k+9pnCb5wgzn8nF9+AssNZOAeFHp3nD/kMA/lD0pO9ACLXs4SR8CIq9gk4hiH7PqUG G0ZRKojfUQIAuD61OeFv3LNMvL3hqDTaVEe4meU/xT7QHoe+srv9l52fuChy0KrALYad TWjr1zm30KEU0z6jycYoF1PpUelyWSMavlIU8JGQeRqZLVo5diifNw3TJedW3RaNX1sz 1ZMIrH5pr4JVtv26UEOFpjnU1VBIsmC25g+TxDRL5yliNpVVw+rXoCNkKe28amEOGCTA 5hhGF/dG40XA9Q18zuMrsPem0xMihC7sYLO5KZPdZK7QyDGyYSXNopfk9AFiA1vSLITl yIcA== 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=Zs06Eq8Cn4syq3obXYkuMUGT6x0Wvcns6Q07jzkmwwE=; b=D7PljF2kPqJcBxg3I25RWFnCNr4TcXhX0lfiM1+tUuV/ydhJEawr1Wshx6KGRm/9m5 Ct7RrU86znXoMzAvIronw3umbim2/T1F4/F6NJyhJ0gHHnxEz8O52Hr6skAW9jMLsESl fsPZ2/iuTvmps0fasgFimlzWmViSn5gbgHOg8hD+YdsI51VSM5jZzHqBOEiJtvCF2Neg n+1qXTHiwW+IYS1Eo2/KwhDuXF/jKlVRhJJztS4rDDCdUb6NlG3kpb8k1lzSze+tHXPI 9ycR2ZJWR4BIOuUKjf3xWs2yFLsOAcZp8SuC2THMkLQORc7Lm5KNgwVeOR+0Pb4yPeky AhXw== X-Gm-Message-State: AIVw112gBFzY3ld7ivnOYuiyOvwDJ45wgPnrxCFLllsHGaa+lTetm4Fz vK5KMbl28kbq8FnYfF2Msg== X-Received: by 10.237.62.240 with SMTP id o45mr10091031qtf.233.1500658153868; Fri, 21 Jul 2017 10:29:13 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id m41sm3813284qtc.78.2017.07.21.10.29.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jul 2017 10:29:13 -0700 (PDT) From: josef@toxicpanda.com X-Google-Original-From: jbacik@fb.com To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Cc: Josef Bacik Subject: [PATCH 3/3] btrfs: increase ctx->pos for delayed dir index Date: Fri, 21 Jul 2017 13:29:09 -0400 Message-Id: <1500658149-20410-3-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500658149-20410-1-git-send-email-jbacik@fb.com> References: <1500658149-20410-1-git-send-email-jbacik@fb.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 Our dir_context->pos is supposed to hold the next position we're supposed to look. If we successfully insert a delayed dir index we could end up with a duplicate entry because we don't increase ctx->pos after doing the dir_emit. Signed-off-by: Josef Bacik --- fs/btrfs/delayed-inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 8ae409b..19e4ad2 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1727,6 +1727,7 @@ int btrfs_readdir_delayed_dir_index(struct dir_context *ctx, if (over) return 1; + ctx->pos++; } return 0; }