From patchwork Fri Nov 22 23:23:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joanne Koong X-Patchwork-Id: 13883705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11D0CE6ADCB for ; Fri, 22 Nov 2024 23:24:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D3CB6B0089; Fri, 22 Nov 2024 18:24:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E2FE6B008A; Fri, 22 Nov 2024 18:24:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 635086B008C; Fri, 22 Nov 2024 18:24:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 45E586B0089 for ; Fri, 22 Nov 2024 18:24:31 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C42561A169D for ; Fri, 22 Nov 2024 23:24:30 +0000 (UTC) X-FDA: 82815312300.27.4D8C019 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by imf12.hostedemail.com (Postfix) with ESMTP id D68244000B for ; Fri, 22 Nov 2024 23:24:28 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=E5+vN0OX; spf=pass (imf12.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732317868; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J6f5Cg5ni0UxlK+AJQaxldsRM/7KRVbxPRgVDGJ6GHg=; b=QDLiMxqje08fnT2qEfU+B52/JAbTTX8UhAz3DoRh4cw6wHkBrSHHxipKd/lpYclZ2jGxg6 YUhW8GPkosHIsAM6HRtIp/bwAEd5he/P2wTKghL0m59wQ55wb2n2jYim5X/JJv56smy1d+ E3uLRXf7WWUlu/Y4bnzwMR8Ge/6Ei9c= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=E5+vN0OX; spf=pass (imf12.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732317868; a=rsa-sha256; cv=none; b=ggImHGOyHXVau2zWx8AvwyF8Ag2x0NfnXvwE4wsI08imVBHWT7RBSUylrObpaOQ6WFrLfJ Czjt6wh5iv4i/sn/sbDC9hLmwUO6+uM39EpYa/VZLETGjpV0qi8PAD5ZIBnd+VhJ6LHeTK TJFUaAiJx21HYI04TW0GPNmX6Yrpsp4= Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-6e377e4aea3so21394467b3.3 for ; Fri, 22 Nov 2024 15:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732317868; x=1732922668; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J6f5Cg5ni0UxlK+AJQaxldsRM/7KRVbxPRgVDGJ6GHg=; b=E5+vN0OXxxGfW7Ig73XQDps701oTR4XgfMZSph5BonnG9+2XGNOuafmTkLg8gya0cB rcgaKJOYzQArhK7CnLQGH8spRNvfhmPyB6paj4Ls/16Td5W9E/kTsK3DmXAAR6R7JwKj TL3FtQqO0YxwmyRCiTJaA8SJFQoCHjrjtC/XOIOb0QXvfYqyQhZusywA0718HxBk3dJB VeFQCprrAepWrF+cMKhgKhtRkX8pIonTW7ftos7+3p9jr3jEK0n2Q+vmjaDsG/Kf2b2y ntLoVFZykwKZcCXDY6cIc91NECoLiw6RWT8hvUHYsu+YSQlTCOyFCsNpHLpCxOLU6XN0 kywQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732317868; x=1732922668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J6f5Cg5ni0UxlK+AJQaxldsRM/7KRVbxPRgVDGJ6GHg=; b=sXdIYQIOuHWK3LosPyHOrgpCGXJzHbmsbZCu4PocIQ+Yzea/qEl+A8PT34H5cc47Pg HBSt0FUNpCxey4SKXzkj5y5q7xTmcl+QsFyWBYVz1lr7wpTCRa+sWUMvuLBMke8uY69K wrN/CYCdP58zKMVGtCuxj4EGgiIqemfL5J3yLp4OPg6H+bsjSliap9O1/DlVy9RIppUr XoJMBh110WFAUSAKWENGImUb/Cbhct7INj4HUiVxSZgF9dpgc81C1YzB71wzDKw5OgTE oyCo6KoBwkmimFRlAUgGBZ4l1haGvUFlmTJARxBANBKWTtvnfQ28KxDgn42no6499k6s CHwg== X-Forwarded-Encrypted: i=1; AJvYcCWNHo2XzL3EbjE/I3vcbgVQ3QKMJNtCZpC/i/YroabQwJQFW57qEPvKcGod8N4ZV0NBYykD2SVunw==@kvack.org X-Gm-Message-State: AOJu0Yw5nfnAZePS0OT6wEd7OsW7wW8p6tl/LCZEpTL7lZmun8+/1l5o ujg0fKCChkh2w1IwZ9UhHo0+9UfZv3YIiPjJUo2jId5EkAnz0qzC X-Gm-Gg: ASbGnctk+v1tWsIW/ni833hegRgitzadC60OOyx6YSwWlRWn6BcudsOUB/l35pJn/QJ zhPoX8erVWARLXfo9K7sdIl9kZaj0ECbbVW0bMeyemG+25QX6al4bStnhky9ItArSIsGLEP5OSa w4pBAYkuNrwONmqKRKsO7bCOEgImtTaisuAmumookJkkJcvcGKmox9s+XvZfdKHjF+lZk5212qJ Xztwj/rUkstC8WDfBcDkY6hG20Pv44bIWCgSiBfb0EpvZOb9/U+0urqZU+mr9uy7DTunmenJMkx iU0J5XX65w== X-Google-Smtp-Source: AGHT+IEnS3FrA3zTT50mBSWxAEndxeY552vJ6l3IoZ28ABUPNtO80E0sf2ZpGC6IcKOhHuSDRBLYgg== X-Received: by 2002:a05:690c:6807:b0:6e3:323f:d8fb with SMTP id 00721157ae682-6eee08a11f9mr64934617b3.14.1732317868047; Fri, 22 Nov 2024 15:24:28 -0800 (PST) Received: from localhost (fwdproxy-nha-113.fbsv.net. [2a03:2880:25ff:71::face:b00c]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6eee0094db9sm6794387b3.99.2024.11.22.15.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 15:24:27 -0800 (PST) From: Joanne Koong To: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org Cc: shakeel.butt@linux.dev, jefflexu@linux.alibaba.com, josef@toxicpanda.com, bernd.schubert@fastmail.fm, linux-mm@kvack.org, kernel-team@meta.com Subject: [PATCH v6 3/5] fs/writeback: in wait_sb_inodes(), skip wait for AS_WRITEBACK_INDETERMINATE mappings Date: Fri, 22 Nov 2024 15:23:57 -0800 Message-ID: <20241122232359.429647-4-joannelkoong@gmail.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241122232359.429647-1-joannelkoong@gmail.com> References: <20241122232359.429647-1-joannelkoong@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D68244000B X-Stat-Signature: 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ehbgMsGtG3FMWq5nvzFrfxfDxP3GfUzpUzHAirxME804iNBFoTS7707nnESJZOORdEAIcgHy+Ac9kUwagXaOJyAV1rixH9wCfPUg7KpFv65Pyyz1LYA93n6vZqvHuDmwN5cjM0wfnwbszBWb0GN0GQXBv9wUlv9t99av5CdPx16564s/YYF5SRnxaZqtiF4Y4l8NoYTAGnN+aUlxDNQyRYE5TRWlJczOCbnp7HLcGQiVmIBjGw003rrMzlXJiF6jUJ9gGBaixrhbBodn1vjZWzWqn/hQZxUZsxuhqDWedEIgMRBwOm4f+6sJenlOaN5reQ97EHQdqwgBNYZrLMWdfr6fK0LDy8PEOMkVecET06OABKdKIjh39ziecv+9Y3FrYlPcLlPN5T57HtrzcUsoguLzQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: For filesystems with the AS_WRITEBACK_INDETERMINATE flag set, writeback operations may take an indeterminate time to complete. For example, writing data back to disk in FUSE filesystems depends on the userspace server successfully completing writeback. In this commit, wait_sb_inodes() skips waiting on writeback if the inode's mapping has AS_WRITEBACK_INDETERMINATE set, else sync(2) may take an indeterminate amount of time to complete. If the caller wishes to ensure the data for a mapping with the AS_WRITEBACK_INDETERMINATE flag set has actually been written back to disk, they should use fsync(2)/fdatasync(2) instead. Signed-off-by: Joanne Koong Reviewed-by: Jingbo Xu --- fs/fs-writeback.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index d8bec3c1bb1f..ad192db17ce4 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2659,6 +2659,9 @@ static void wait_sb_inodes(struct super_block *sb) if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK)) continue; + if (mapping_writeback_indeterminate(mapping)) + continue; + spin_unlock_irq(&sb->s_inode_wblist_lock); spin_lock(&inode->i_lock);