From patchwork Fri Nov 15 22:44: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: 13877388 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 088FDD68BDA for ; Fri, 15 Nov 2024 22:47:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67E096B00BD; Fri, 15 Nov 2024 17:47:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DECF6B00BE; Fri, 15 Nov 2024 17:47:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 284916B00BF; Fri, 15 Nov 2024 17:47:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0996D6B00BD for ; Fri, 15 Nov 2024 17:47:01 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B4A99A0683 for ; Fri, 15 Nov 2024 22:47:00 +0000 (UTC) X-FDA: 82789815108.15.4D0DB49 Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) by imf05.hostedemail.com (Postfix) with ESMTP id 3BF2F100003 for ; Fri, 15 Nov 2024 22:45:32 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aL1sOIGY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.128.181 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731710687; a=rsa-sha256; cv=none; b=7XE8sSfHwXKLAfc5JH+x4mM6jNz/ZZTSOwwN+5VNqXuIerqI29MqsxBk4+HfdU3AOtlewm 7b+lA9AK19PFv6zIL+doLk6gM04fc693Ob24+gq/aV5snqgQp/+DhUQ6qF4y1iVZgQqbh7 T/zdiBhvJsQjEHLUJVuflN09EvOpjs0= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aL1sOIGY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.128.181 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731710687; 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=fqTpYYj0xuVtKi0W3IidBx7k3eo4EvWfLhMFNi1N48k=; b=dXLMJ9GEKefcfMg0P9M9UMQQWqrjazkvapGp3Gg3Ycrz0jd6HsaZB13mMNPIX7Tor5Eog3 m8QSQWO2VEyBspvLkjbiXtEdISovHZ3GuiiXrREjJeHbA+YK75YUEXvzCL5ysQPzHKrFq8 39yTPspt68x71TDC2RySyZt4OlRozVM= Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-6ea7c26e195so13701847b3.0 for ; Fri, 15 Nov 2024 14:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731710818; x=1732315618; 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=fqTpYYj0xuVtKi0W3IidBx7k3eo4EvWfLhMFNi1N48k=; b=aL1sOIGYQ2FMpZQfO4hT4CI4WfGwzI18JDseXvx5XqNu+Wl5ek2N7ibySx5Uu50yNn XaHN1alSQpDrxAoITD5OJnPWB1WjbiHJoI+poP/l7+0jQ+RfJ4FNs3l+pPQW+70yRhQG nVJ2M32n97pAdkeKIeFRHjp8erUu8YCVmu27FnYkX3O9gx2E8eLeCV3HEkb5s1c/byE8 vH1wXGzuI3zaVfhzH6mFqBKeArfKbrOkdEzesHMgGAdpy1LJDR06jkJWCOr6FrXz8Q2n AnAYCnRpAYUQe1SccLkg8bgZsIwd+Iijrf0H+GedcrBj6fVHXIfmaCuoUo/Vw4epiGVo W3kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731710818; x=1732315618; 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=fqTpYYj0xuVtKi0W3IidBx7k3eo4EvWfLhMFNi1N48k=; b=vgTiXqi1AKwE1u+SHmKzBhfbmxHTWYrHuSRksGXmDl5Mn5QJpNCyCnN7PZ4QN5N633 f6Y6qUTR/j6xgV6MiI5gvXQhZd7G2ljnQPKqyc5THVW+xxDknTvx99gpU1+hhbH44HBg omJerQ9rIJ+S6/Wr8wx/5xMkhgqHOz265ecOpTFN07FYbkGnOaKa42aG6EQ8brr7GHCx uGcfnPpy1zIA3rP3MzXVMtigyrztecWftUf9dybaX2Tt3TaGo8GD11oPZ6IodleDA42n JY38q5L4xK5/A7h6rMfmuT26T5hv/7xlo0J+fz4wFg8uJapVUoyRtCYsJ7MyK01XKQ6O FeSw== X-Forwarded-Encrypted: i=1; AJvYcCVL63q5FHe5gKjhvKtr8Jw++4weeEMEV+XYA1bRrlK3mWRGM+m5Xq6FMXLU53FQLsiyMxzqVIbaKA==@kvack.org X-Gm-Message-State: AOJu0YznC4NQQ/Ss6mpMqRj5GZQl+z+4yxGqOwHWRT+AUyIG5hP2xl7t AmAV4lZqSn2mv/L1b0cAKRSZaeU+vodDQhZFocZS0VzWS1p7duEA X-Google-Smtp-Source: AGHT+IHG2B4pBIMlMPyc7j9/RbvQB2IU9wmY3MOJI56h25nmFtflz9zG3n4erefydZn7TRsiabBC0g== X-Received: by 2002:a05:690c:6486:b0:6db:ddea:eab4 with SMTP id 00721157ae682-6ee55c7897dmr58857977b3.37.1731710818032; Fri, 15 Nov 2024 14:46:58 -0800 (PST) Received: from localhost (fwdproxy-nha-007.fbsv.net. [2a03:2880:25ff:7::face:b00c]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6ee7127890dsm879117b3.11.2024.11.15.14.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 14:46:57 -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, linux-mm@kvack.org, bernd.schubert@fastmail.fm, kernel-team@meta.com Subject: [PATCH v5 3/5] fs/writeback: in wait_sb_inodes(), skip wait for AS_WRITEBACK_INDETERMINATE mappings Date: Fri, 15 Nov 2024 14:44:57 -0800 Message-ID: <20241115224459.427610-4-joannelkoong@gmail.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241115224459.427610-1-joannelkoong@gmail.com> References: <20241115224459.427610-1-joannelkoong@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 3BF2F100003 X-Stat-Signature: w6dtcuty9fcx7rq76bppxteq6y53c5ge X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1731710732-436596 X-HE-Meta: U2FsdGVkX1+lpK9vh6nAFmF5O6cBJtEUqzNZviOIA00jFQveS09bqoSo5GFOqr+FRCqMJxdFpttMlIvbr74dJkc7N4idYfSo3mCyJUBFwyq2inHiYfFxoVV9q5UyPyYXQOMmzqxkRTCm/m04KLasTGIYPlZ3dVI8JqyA0q1Xp6CGdVIJ4PLpJde/uFcY4pt2GkNM88/9k5UNzqe+knuw2bG+Ppz3REA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dW52GOy2o24K9XC/AQYULCO+WTIFS5mEtd7XFS6yFi6LKJOi+uaVy/OQO5Ntbf8lE9/DnVAahfYpqL8AjY+pS2s4sax9gdUQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, 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);