浏览代码

btrfs: increase ctx->pos for delayed dir index

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 <jbacik@fb.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Josef Bacik 8 年之前
父节点
当前提交
42e9cc46fb
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/btrfs/delayed-inode.c

+ 1 - 0
fs/btrfs/delayed-inode.c

@@ -1727,6 +1727,7 @@ int btrfs_readdir_delayed_dir_index(struct dir_context *ctx,
 
 
 		if (over)
 		if (over)
 			return 1;
 			return 1;
+		ctx->pos++;
 	}
 	}
 	return 0;
 	return 0;
 }
 }