From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 592D6C43387 for ; Sat, 5 Jan 2019 17:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2915F2085A for ; Sat, 5 Jan 2019 17:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546708470; bh=pbtZ1FEkqCjE6s2xVKcw2RVBtBRpwcP+GwZpRlUyAVo=; h=Subject:To:Cc:From:Date:List-ID:From; b=BfX4+3VIgqB3nzaf/b3TDNzuiAO7dViFGv/frLvyVZnVYkdAi2e2ZWcxGZiHPSynr 2Cb/0djc0Id7iOJfGOceKO+KFcpDBsNhHk3mpkXON5UGkDh4cD0Mbd6msX8Ng8J4ho RNLDuVfdRyoTvLF5N5esHKbhrc+mS893TI5ZWT98= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbfAERO3 (ORCPT ); Sat, 5 Jan 2019 12:14:29 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36117 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbfAERO3 (ORCPT ); Sat, 5 Jan 2019 12:14:29 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A8C06219FE; Sat, 5 Jan 2019 12:14:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 05 Jan 2019 12:14:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=9n5UBz uuTZxqObDtEEWk0Gqqz3oUOD2VCnf16JDU1ec=; b=I4uh9VY3396tEu/iT+XL8n 4VC8HRovtoOJf2M1rwkiXS/wYhMl9aMMFNAZaleTe52rUOEByK9iF+ShqdrtGlo7 TnMVFj3CqJryuKS22TvY8QyZO3/ao7hwsFpd8p9PCva/NYgEyHYQfG4vCPqwlK5y sPjh+X9FgqawL2AavUJl/FegSqeV7oslu1uVZ4r8HUcC7Uw9nDrq97IIV2ubLWUF FyKPLv9fGBlTIipFQ+4u1iuCx3y6Iq5SyrGB0QDIwmZiITEEwc9EA6hLHj1B+AnS ZI3yOQ0Vp6LzJOCHD36RUntovcmM5qwkleddkPNDaRpDTGFih5epNkM007rt907w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdefgddutddtucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucfkphepiedvrdduudelrdduieeirdelnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from localhost (unknown [62.119.166.9]) by mail.messagingengine.com (Postfix) with ESMTPA id BBE23E4664; Sat, 5 Jan 2019 12:14:27 -0500 (EST) Subject: FAILED: patch "[PATCH] btrfs: dev-replace: go back to suspended state if target" failed to apply to 4.4-stable tree To: anand.jain@oracle.com, dsterba@suse.com Cc: From: Date: Sat, 05 Jan 2019 18:14:10 +0100 Message-ID: <15467084507752@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 0d228ece59a35a9b9e8ff0d40653234a6d90f61e Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Sun, 11 Nov 2018 22:22:17 +0800 Subject: [PATCH] btrfs: dev-replace: go back to suspended state if target device is missing At the time of forced unmount we place the running replace to BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED state, so when the system comes back and expect the target device is missing. Then let the replace state continue to be in BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED state instead of BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED as there isn't any matching scrub running as part of replace. Fixes: e93c89c1aaaa ("Btrfs: add new sources for device replace code") CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 32da6901dc88..11df8f778b63 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -890,6 +890,8 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info) "cannot continue dev_replace, tgtdev is missing"); btrfs_info(fs_info, "you may cancel the operation after 'mount -o degraded'"); + dev_replace->replace_state = + BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED; btrfs_dev_replace_write_unlock(dev_replace); return 0; }