Message ID | 20241220153314.5237-2-cel@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 92A27E7718B for <linux-mm@archiver.kernel.org>; Fri, 20 Dec 2024 15:33:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21D686B007B; Fri, 20 Dec 2024 10:33:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A61B6B0082; Fri, 20 Dec 2024 10:33:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06E486B0083; Fri, 20 Dec 2024 10:33:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id DD1326B007B for <linux-mm@kvack.org>; Fri, 20 Dec 2024 10:33:21 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 89E01A0B93 for <linux-mm@kvack.org>; Fri, 20 Dec 2024 15:33:21 +0000 (UTC) X-FDA: 82915728966.17.2F762DC Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 44F401C0011 for <linux-mm@kvack.org>; Fri, 20 Dec 2024 15:33:04 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=O2ZRPhRi; spf=pass (imf18.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734708764; 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=rtEIOXSYejtFTXTHI6ihz7mrnbnMF5r34b6HRlDEink=; b=6Ez2aIaa0vO6yTmjg3yoS/sKD+CdcFHuCezEtSNLG1COpMPaRWxkzIWpBX8XuoO7QkIi+Q /PyCLIiQap6C8EQCjId6cGGr+wDj4MB6iyz/kbsoyTwvjBAryAycjYWNxXzHfFz2CJmSqC 7xoKxoLGzd3kYtF+Cx453Y/Xj8uy5bI= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=O2ZRPhRi; spf=pass (imf18.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734708764; a=rsa-sha256; cv=none; b=IbC21OGmkQMcwAJmrsSQ/79RHlZ7WcXMv2sy/Hzcm6ij0NmghwVjWPf/W8QyAlmqVXK0iB 4z6POozSVVbQRxRWj4TIiJ/CmDGlzG1obb7eBAAv0E8Trw8X67bZqvijDgUArVkg9kJYGn +fM3tI5vDq0Y3qnlDUSfBgRw+MCUyfY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id F1DC65C621F; Fri, 20 Dec 2024 15:32:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB35AC4CECD; Fri, 20 Dec 2024 15:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734708798; bh=EECtu5EOQPP9WpkyAeyEzP3b+8wuy+Niq71T6d9EZWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O2ZRPhRiASStEU5s/qWXh04LDWsiGjNPKUEulej0MWKn/cJxk5FsBJ+q9c+2xnrp+ iEXCDgelMCJMK66KZI+qiZDL+LgrM1fWELgH9owlLAaDFlotlcNi2y41Gm5vEbW4YC hycvZzYjXnPVLrDq3FfkrcVJ8uUhtyzAbOZqE+x52eZY1zPGP/nQV5nnxOc/g9kUnJ bHItBtmY2eBLwNO63tPWFmfKSgX8z2nVUzjnFrwD7a5KopNGDN5K5pM46WX6nrIN9i KRp7CxTH5sembrL3X3Dcy3mFD0DQ8clz5c9abI6gYfbv4gA9jj8pO+wHpMpJiQQMDM G+SvL/EzaYILw== From: cel@kernel.org To: Hugh Dickins <hughd@google.com>, Christian Brauner <brauner@kernel.org>, Al Viro <viro@zeniv.linux.org.uk> Cc: <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>, yukuai3@huawei.com, yangerkun@huaweicloud.com, Chuck Lever <chuck.lever@oracle.com>, stable@vger.kernel.org, Jeff Layton <jlayton@kernel.org>, Yang Erkun <yangerkun@huawei.com> Subject: [PATCH v6 1/5] libfs: Return ENOSPC when the directory offset range is exhausted Date: Fri, 20 Dec 2024 10:33:10 -0500 Message-ID: <20241220153314.5237-2-cel@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241220153314.5237-1-cel@kernel.org> References: <20241220153314.5237-1-cel@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 44F401C0011 X-Rspam-User: X-Stat-Signature: w47n3c8qsuowz8ezkd14xgy7amhe4iwd X-HE-Tag: 1734708784-211009 X-HE-Meta: U2FsdGVkX1/L3s/4HV9j//FZFbA4EGvMdjEgkFeLxkUfIlnQ6AbAOxqN71yCUmzoqCacsO0AQXf8u0+VJO9AJhPz/ZBvWzDZjemvYTYym1oX6p6b0OS8JMqOafimagtiewcgXZXhJgjI/D29StHSMY/jq3xEggK5MFV70Ml5n0kbCFTB4gUOhdON5J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== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Improve simple directory offset wrap behavior
|
expand
|
diff --git a/fs/libfs.c b/fs/libfs.c index 748ac5923154..3da58a92f48f 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -292,8 +292,8 @@ int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry) ret = mtree_alloc_cyclic(&octx->mt, &offset, dentry, DIR_OFFSET_MIN, LONG_MAX, &octx->next_offset, GFP_KERNEL); - if (ret < 0) - return ret; + if (unlikely(ret < 0)) + return ret == -EBUSY ? -ENOSPC : ret; offset_set(dentry, offset); return 0;