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 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 76F12C43387 for ; Sat, 5 Jan 2019 17:14:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EA1A2085A for ; Sat, 5 Jan 2019 17:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546708462; bh=ICaLghFX3ebf9Q5Ru7uqqr1z8k1OmZqbRJM16hlYcFw=; h=Subject:To:Cc:From:Date:List-ID:From; b=T5l2/mfcv+g/Q6SoZA4/iB68HdlVKWLmNrLpQa9DqkaAZCSggkPuN4pnbjE7y/7G9 d+j9JfOlnzIDFQ19Kfl+m73bsNqFmx11CAvEYnFBRVGDLloo0A3W9YtCc5A3vg4qp+ 9j5o6yuYXtOi4L47VfYH6RgzYhjRjQUvuWQGRtLg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726263AbfAEROV (ORCPT ); Sat, 5 Jan 2019 12:14:21 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54245 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbfAEROV (ORCPT ); Sat, 5 Jan 2019 12:14:21 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5023921144; Sat, 5 Jan 2019 12:14:20 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 05 Jan 2019 12:14:20 -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=EHST9J 9uwyNfrZd+Wx7tp7MvMAaf1QOukRXaJ974TLM=; b=vxmd8mYCUuX/s7slFfOKbQ FqtmEfvNCCzw1plXKJMlPMpK6Aahlwb52u0taBSDOHiI7c3g+T/jdJQevnNRG3kl igVlpP508TlRIs+TV1ADVbTiK0l3IcnceCLE8R3qB4lgc3lrNkrVhqcZfPo7TlQM kogXpq2IqWzhXt9v4sxgL27EfKiHK++gZANdUrcK1nKwrrEoYliMtj6qDaWMCAg2 9IOUxllgFVuZJJGJ38okQy0aXKlHb2Y4Dnjtv7RZwo6/AsMlvZoipdMUdrahx7nU Txlbn3ELi61lZmFpI8LBSTuogy9iGhhweeOzhuFlIdZDMPcUFxScMOBBdYeQMI7A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdefgddutddtucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucfkphepiedvrdduudelrdduieeirdelnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (unknown [62.119.166.9]) by mail.messagingengine.com (Postfix) with ESMTPA id C47A7E40A1; Sat, 5 Jan 2019 12:14:18 -0500 (EST) Subject: FAILED: patch "[PATCH] btrfs: dev-replace: go back to suspended state if target" failed to apply to 4.14-stable tree To: anand.jain@oracle.com, dsterba@suse.com Cc: From: Date: Sat, 05 Jan 2019 18:14:02 +0100 Message-ID: <154670844210567@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.14-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; }