From patchwork Fri Apr 13 16:03:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10340361 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 5DA666039A for ; Fri, 13 Apr 2018 16:03:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5621C1FFDA for ; Fri, 13 Apr 2018 16:03:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A6BF20499; Fri, 13 Apr 2018 16:03:41 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 E84791FFDA for ; Fri, 13 Apr 2018 16:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbeDMQDj (ORCPT ); Fri, 13 Apr 2018 12:03:39 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:44940 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbeDMQDi (ORCPT ); Fri, 13 Apr 2018 12:03:38 -0400 Received: by mail-qk0-f193.google.com with SMTP id n139so9613932qke.11 for ; Fri, 13 Apr 2018 09:03:38 -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=CpbGKRhorDBj/PX0F9HGBG0P8PQJiSwwHp7+cE2ByPc=; b=sxylEd1mSLkNUwRYuT/+hwYCoigZBb+Ms1K9rKhAdm1DM77sA8y5G5iPFEedDPRTc9 53VrX/ERH6LYmmt1Npycgevd+xjm8w7Yn3E64uya8/GXmBlRCfu8E92FtYNdB/7BcqcV r7M7ay3Lp1yEWbHcuds9rMhP0FZxCTH5oPcoWVCAu2IwVdaSb9ZOQLjMTPAQcSOh9inM r1K6xO4N2F/vZtuYR0k15WSjmfkSW8jebrliusEANUuBXdu2AO9Dq0gO0zkN3BFoTHVZ FgdxRAjAHQk0q4TOn6GGsm1rQz3XNOj1mSxt/jU7Ni01dOyDzUBqjCvgexZYj88j0UK6 agbw== 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=CpbGKRhorDBj/PX0F9HGBG0P8PQJiSwwHp7+cE2ByPc=; b=DABTHUGILDvnam6tLbCsPlXjLHrkTjwX1dnbuMicGpLIkpizxwkDOgKsteOVhdShyz p4aCZDM4VBVrOC0gb0f6uYgrTSJ6LhIS6IxrsrThBM3dnqtIrRB/VaSc1q4TcXXczPiK kQ8BKdMvkj/pw0j5xkSupZBKu0agb6qTgYGTllClADbkYmAfKwsdmyu0CGw/hU1ePOzk lgTVmskj2bGQBnzUWhw1sPcRsvoXWXhq1VIB2ZqBzKtX0uEy4kQS69JCTA1J+XN3kCrh v9KQ/bm17gOqia0BKXnslWlv/K2edLlwVnXT8LP1F2PheACZJCZ71O+fVeF4p87z6Gf/ aFZQ== X-Gm-Message-State: ALQs6tCsWtwf4RNZjZoFl+VA9rwoMitrj00PvyL4eGyED4RhW3HN+XKc 40IFw9bGy9X0nFODsmUI5wmkRHfu X-Google-Smtp-Source: AIpwx49BiNX+iX1lqKK0RnRT3gT0C9MZiZjmR/R/uhrCKxhZo6E9Jvxm5ByuW/MD8N3D7GT3CPdP/g== X-Received: by 10.55.144.68 with SMTP id s65mr5180232qkd.226.1523635417668; Fri, 13 Apr 2018 09:03:37 -0700 (PDT) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id v133sm4711354qka.12.2018.04.13.09.03.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Apr 2018 09:03:36 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, nbd@other.debian.org, linux-block@vger.kernel.org, kernel-team@fb.com, alex@iss-integration.com Cc: Josef Bacik , stable@vger.kernel.org Subject: [PATCH 2/3] nbd: update size when connected Date: Fri, 13 Apr 2018 12:03:33 -0400 Message-Id: <20180413160334.5496-2-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180413160334.5496-1-josef@toxicpanda.com> References: <20180413160334.5496-1-josef@toxicpanda.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Bacik I messed up changing the size of an NBD device while it was connected by not actually updating the device or doing the uevent. Fix this by updating everything if we're connected and we change the size. cc: stable@vger.kernel.org Fixes: 639812a ("nbd: don't set the device size until we're connected") Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index e33da3e6aa20..1520383b12f6 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -243,6 +243,8 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksize, struct nbd_config *config = nbd->config; config->blksize = blocksize; config->bytesize = blocksize * nr_blocks; + if (nbd->task_recv != NULL) + nbd_size_update(nbd); } static void nbd_complete_rq(struct request *req)