Message ID | 20241204155257.1110338-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 D5B48E7716E for <linux-mm@archiver.kernel.org>; Wed, 4 Dec 2024 15:53:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E1F56B0083; Wed, 4 Dec 2024 10:53:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 46BDC6B0085; Wed, 4 Dec 2024 10:53:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E4E86B0088; Wed, 4 Dec 2024 10:53:07 -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 034206B0083 for <linux-mm@kvack.org>; Wed, 4 Dec 2024 10:53:06 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A0486A103F for <linux-mm@kvack.org>; Wed, 4 Dec 2024 15:53:06 +0000 (UTC) X-FDA: 82857720246.14.BECA256 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id CEF2918000B for <linux-mm@kvack.org>; Wed, 4 Dec 2024 15:52:54 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=RwglIqew; spf=pass (imf06.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=1733327578; 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=vg3hQgOI0fVKCLF8XazcHrwtTTk7j4qHHHqA/NO5wZE=; b=1JkzjOCa6ZI2NYMnHlSoWQsopFL5E/0nSul5zt4LuvbIdD4uavDKitj7KSi1BQMxnL0Ov8 yBi/x7j+GV60xawGkVfI2+/A4Gv+vY3sbRqyE5b/gBFW/8Y8gRA64YQ4thjk3r5F7FQxEe qp2d+6EYqEONK0gfqWy6bizJzk3Rc/I= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=RwglIqew; spf=pass (imf06.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=1733327578; a=rsa-sha256; cv=none; b=PxGVtlU6tfW1PbW3jpJajhFLZr1vO67bPKS5Jkavir0M4fkTpMPcf98Z/T8V54hn/1eBzr NYkn9piTkwp5ioR9NMaiiHt8Nw+VMuC5MGJL22JT4bUvYM88nwaWXipxIZDEL+YtE/jXik GBLRrC3mBaOTi9pySpYwQ3NhjqwW25A= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 146C35C6E8B; Wed, 4 Dec 2024 15:52:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B27D4C4CED2; Wed, 4 Dec 2024 15:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733327583; bh=NPVXYksZkbK7cP6WTdZWPp256P2B4FMiN2imk2oaSkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RwglIqew+kC64HhmNeKRZMoydHTLxQALFth57WAXtBp6byNwVy91qJItQVVVwojSA OkH5/L9gFNYk/6f41QdqZVsf1I2GmIUsX/4V31OwNPFvaJMr9SwVKkROAY+FZFJze/ sL6tPNFlm19SV83JQXjaj+kPOEpM9/DycJQGqlRjtPJoey30zf9xUANBSL4qJbGTsm ql3tCoKZMlCrvZi0a1d2Z0oYByif2FG4pmAFUVUn+0J2Sjxv7GbWrkmPErKaHMypJC RFm8Yrwrio2mbZMJVEfnv8HExzhNKe4ZzOhXk3nxN7ocFTlW6sNuRZQYmSubZyHZ+h xfYcWMt80NU3A== From: cel@kernel.org To: Hugh Dickens <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 v4 1/5] libfs: Return ENOSPC when the directory offset range is exhausted Date: Wed, 4 Dec 2024 10:52:52 -0500 Message-ID: <20241204155257.1110338-2-cel@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241204155257.1110338-1-cel@kernel.org> References: <20241204155257.1110338-1-cel@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CEF2918000B X-Stat-Signature: yq5hs3ikegxfo1ro5p999nwpfgd7pj1f X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1733327574-830750 X-HE-Meta: U2FsdGVkX1+/G7j1jZKvUGF6Ier7ynnydMUQYrWRGjFZlA4aCinxauLjjKUjINBnL4q9ecnp9xE7gyuITxzjLSuJZVvAfrWMPOmmSD50jYl0vjR5bLR4l4sRvIhQEFNnaht1OOxfRu9MNbkXgO98mmfUATJnyaSqDTkB3eyVRoXbidKhfWOXjAyOewtHESaWWQjRBnwo5gND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ofilter, 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 46966fd8bcf9..bf67954b525b 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -288,7 +288,9 @@ 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) + if (unlikely(ret == -EBUSY)) + return -ENOSPC; + if (unlikely(ret < 0)) return ret; offset_set(dentry, offset);