Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2636538pxb; Fri, 5 Nov 2021 01:57:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxqZnxz2EP53JeaGJDkHj6Cmf48I9u8PU/7rDIZPLFn/SPbPf2ydK8Yk5ixCWK/hiMmZ0v X-Received: by 2002:a17:907:7b99:: with SMTP id ne25mr39391426ejc.15.1636102655352; Fri, 05 Nov 2021 01:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636102655; cv=none; d=google.com; s=arc-20160816; b=ORFD2VCe24RMsT1V0QYmwN2toS2XWNwNoRAd6zfPc2kRq3zJbYRrvpN+EyKrz20UWc LvRHSDxi+Z82Lss09HHrSYDXXaM7lkIQu/Ifafjta8zDySVRyDzFuHRmT8WQIcThoT2x tBz+W0xAvJqE/pQAcOTa4JVmpVmeEXz/9RAVuUIsVPJ/dwvPdsrnggMZfBX/qu+HjCPu X7z4N5e7rbegaXutFgpUgVKlxZjJoHkrVmmVeo0mdYsyDcgCqkT/BR08350rXdJ7gLb4 xhIc4+Sfrs7NOv9LyHxL/jWXU8VpVkAs623aMtRm8nUYj6rKBpIT08kajcoWmCj0IrX1 Bz4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GRTujGi+sy1rr9SXq3vyA2WZa6620/hnapLNeBSKgOc=; b=KdXrUMyNx9ZrR2DJF2egZ/NKxBixuriWuEsGIphhDLie+O4lr3pb4S//aGJg8XpbWU wGdJ+7dxhFj4xXGv5DS8qMmxF6lxiFlFO6GQmO7pRifGsxHTe+39GKPb1mMVUx6LvkzA UxcTDBF+eiusaEFeAqahmPxiMUxIYg0JcAiNOufW39yTr4yh7tGGGYbgGyYmY7MOKEb9 skLvqFy1MJyFnerOWyXpg5CczNBMagGdh6VPPG66uhgBhYAd3lndHmkgULbT6cIeH0Bv DVIrH6h+MEdgq1Q/mD5szCGu3eofsxfFW6GzlXbOIFMruQ+U0bRtyavLcED/prq0I3eo CADQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qf31si14466391ejc.782.2021.11.05.01.57.11; Fri, 05 Nov 2021 01:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231646AbhKEINg (ORCPT + 99 others); Fri, 5 Nov 2021 04:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbhKEINf (ORCPT ); Fri, 5 Nov 2021 04:13:35 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F7DEC061714 for ; Fri, 5 Nov 2021 01:10:56 -0700 (PDT) Received: from beast.luon.net (unknown [IPv6:2a00:bba0:114f:8c00:217f:12f7:a43b:2a0c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sjoerd) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 5F8D91F46617; Fri, 5 Nov 2021 08:10:54 +0000 (GMT) Received: by beast.luon.net (Postfix, from userid 1000) id 224081BBE5E9; Fri, 5 Nov 2021 09:10:52 +0100 (CET) From: Sjoerd Simons To: linux-um@lists.infradead.org Cc: Anton Ivanov , Jeff Dike , Richard Weinberger , linux-kernel@vger.kernel.org Subject: [PATCH] hostfs: Fix writeback of dirty pages Date: Fri, 5 Nov 2021 09:10:51 +0100 Message-Id: <20211105081052.2353801-1-sjoerd@collabora.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hostfs was not setting up the backing device information, which means it uses the noop bdi. The noop bdi does not have the writeback capability enabled, which in turns means dirty pages never got written back to storage. In other words programs using mmap to write to files on hostfs never actually got their data written out... Fix this by simply setting up the bdi with default settings as all the required code for writeback is already in place. Signed-off-by: Sjoerd Simons --- fs/hostfs/hostfs_kern.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index d5c9d886cd9f..ef481c3d9019 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -924,6 +924,9 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) sb->s_op = &hostfs_sbops; sb->s_d_op = &simple_dentry_operations; sb->s_maxbytes = MAX_LFS_FILESIZE; + err = super_setup_bdi(sb); + if (err) + goto out; /* NULL is printed as '(null)' by printf(): avoid that. */ if (req_root == NULL) -- 2.33.1