Message ID | 20241228175522.1854234-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 E0E33E77188 for <linux-mm@archiver.kernel.org>; Sat, 28 Dec 2024 17:55:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA4626B0083; Sat, 28 Dec 2024 12:55:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C54B26B0088; Sat, 28 Dec 2024 12:55:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B42A26B0085; Sat, 28 Dec 2024 12:55:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 93F3B6B007B for <linux-mm@kvack.org>; Sat, 28 Dec 2024 12:55:32 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EBACB80DB3 for <linux-mm@kvack.org>; Sat, 28 Dec 2024 17:55:31 +0000 (UTC) X-FDA: 82945117878.01.052E581 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf26.hostedemail.com (Postfix) with ESMTP id 79CD4140008 for <linux-mm@kvack.org>; Sat, 28 Dec 2024 17:54:56 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Uma4kQ2k; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf26.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735408488; a=rsa-sha256; cv=none; b=NOF9SNZVTf5Ls1xjkcmJl1fxPhhFkJrdnq7/p+DtK3HPDfkjExkqHQjgian1shfbTvU2Jf QT85TWhzJuWfuk79IyWb2ERLg8GrszpiZ1wvg0/W0CjoEybJkmy/mE37LBvEag3IQWtqrG cAmalgeXmjGMr+21l3/rQnUDSQPaVCg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Uma4kQ2k; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf26.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735408488; 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=QwSceylqtXqnJNXNAznPPjbHzE+Q91NYDrNMw5aytshwiMVVwAClTG1a6cOYpH16eWdT+m oXHeCAgHXhJ+LIRJADNArFLZFcQd1EJyc9xnlK+SdhIc/j6RGrXImi/3Jp1o5V+OS8uOCy OuJVBWUXIGX3NGr5IIQLR7xPY47qg60= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C579F5C5506; Sat, 28 Dec 2024 17:54:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B35BC4CED3; Sat, 28 Dec 2024 17:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735408529; bh=EECtu5EOQPP9WpkyAeyEzP3b+8wuy+Niq71T6d9EZWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uma4kQ2kNj/TOCp8GofUQATKtCXg9pKPiiaPxerbHBR1J1MtjzVlVou7vExRGYGtA 65BSwylOREkYANw6gZKPDWebHMXN4k54oQ/kIWEaY/Tgi6t6zOjpKC/K5hq/JaKl8G WJ3Fq5btLxjxUIm9QXgeg6JEOg3z1AHfae9l+B9RTK2SGB3zJQUQNpb0OZQsq/iQ3r BjoMXzIKW60jDKbAY5trHgHFPHh6VVByIH3v5JCNoZrhwJDCuOnSTjBmT3hCC1c16T AhH8e3ewz2IJ54b5YjFJ1RfSnphPqXvPxHQkWYWOq9A4kLiOB/+TecXx07wZl7E7Fb FasZ5Fxn2KSyg== 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, Liam.Howlett@oracle.com, Chuck Lever <chuck.lever@oracle.com>, stable@vger.kernel.org, Jeff Layton <jlayton@kernel.org>, Yang Erkun <yangerkun@huawei.com> Subject: [PATCH v7 1/5] libfs: Return ENOSPC when the directory offset range is exhausted Date: Sat, 28 Dec 2024 12:55:17 -0500 Message-ID: <20241228175522.1854234-2-cel@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241228175522.1854234-1-cel@kernel.org> References: <20241228175522.1854234-1-cel@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 79CD4140008 X-Stat-Signature: ybymxeqhmqx418a4ebpt1u34bxpo634j X-Rspam-User: X-HE-Tag: 1735408496-747316 X-HE-Meta: U2FsdGVkX1+XPDrydbS0aZaAnpSNGgqczm9IGe6iOXvyuLSCHV9C4rIA38NCtklRgHmkduM9+YC87JOzHN0qMxvuRS7LwrfMgE9XF1lLoIwaXdM9LoeHS7MgvzYjArIMzYkexPYQOpK4hD05ddDrSawy/ELxSS79B5ux6ND936D2P2rAswjuLtU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: 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;