From mboxrd@z Thu Jan 1 00:00:00 1970 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 5DFEEC4706F for ; Thu, 4 Jan 2024 06:58:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4C826B03A4; Thu, 4 Jan 2024 01:58:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DD54A6B03A5; Thu, 4 Jan 2024 01:58:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C75EC6B03A6; Thu, 4 Jan 2024 01:58:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B47DE6B03A4 for ; Thu, 4 Jan 2024 01:58:10 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7425D1202DC for ; Thu, 4 Jan 2024 06:58:10 +0000 (UTC) X-FDA: 81640724340.10.E962067 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf27.hostedemail.com (Postfix) with ESMTP id 643D240004 for ; Thu, 4 Jan 2024 06:58:07 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bkD3+cWG; spf=pass (imf27.hostedemail.com: domain of djwong@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704351488; a=rsa-sha256; cv=none; b=ks+f6rpCEk1B6kLfMjE0H+nDN2j6G3AcuAWPOBUkttCDs4tuYFsJQBObT8YKcr0ygV0SXf /CEtlfFrwFLfUKfmT9VtnQ9ClGGupbK4i38RyTRTrFi3xdIQgHou5fQpRlzQbsyGanwibs BbujmBRkmr0I3a/c8/W6WmLAcOY/KKI= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bkD3+cWG; spf=pass (imf27.hostedemail.com: domain of djwong@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704351488; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1c0JCKeVnRwn3V0nKEHe/+uh1tF+R5IppxjYQ/7uw6s=; b=a0U8Wo1O27ohBlr6vnnIGQtHN4XkvzhAexLM9X4o/wqFmXJqTOaNxNbboO5xZ7QaLFY5kB aguN2dpGIljX0RaY+S4Z/wAozyGzIX1JQZjP7CZvLTzCFKk+IR2TPDwSPLPJ+dog2Vusw+ ThSE9IbMB+K0zE+zosUCBY0XdeA/FuU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 6EA52CE188D; Thu, 4 Jan 2024 06:58:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4B8AC433C7; Thu, 4 Jan 2024 06:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704351484; bh=Ct3/IBHmXYYDgzQNq6VGWbWP3rrbg9WpHkngjmYmp1k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bkD3+cWGhrmwgRBQouYKWUSnW+Yp1BkILp0XnzBk7j33GvtJEHUGg9F68ImuMXppq uA8tQCcCD4DIVbd7hu/r70XEu32zSAWBuS/XPyz4fj9L2gWxci0K9VmxrhOfIkTqew cR5bQFbixA9rC0jDSI4arXkTC4ss/PSLMTXdHIT+vlAOmS7yH00WYvMkfo2MCLeCnL BE9H0Fdiu2tnbfajiZ/awbPp8nN8THcpUCqsQSaqnneLqvQBn1gXq1bbjxLQ5GScxu VREO20RLuAXW6FhX1E4t8Fjsc4rEPsIUBvVqOHCd80VYM87cK76BzlruCT8jg50GMk yFz0g+Lx2VQEQ== Date: Wed, 3 Jan 2024 22:58:04 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: Chandan Babu R , Hugh Dickins , Andrew Morton , linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 05/15] xfs: remove the xfile_pread/pwrite APIs Message-ID: <20240104065804.GW361584@frogsfrogsfrogs> References: <20240103084126.513354-1-hch@lst.de> <20240103084126.513354-6-hch@lst.de> <20240103234849.GY361584@frogsfrogsfrogs> <20240104061542.GC29011@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240104061542.GC29011@lst.de> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 643D240004 X-Stat-Signature: faopi1do5ybygizy5pmjj5sm44momw4a X-Rspam-User: X-HE-Tag: 1704351487-583113 X-HE-Meta: U2FsdGVkX1/i1XB+6+/HUB+8hygps8BhvKQ4jLVl3IaEh2sfqi9yu/nCFD5wZPG1i0UKU/ZS+nb4cquiKACS1L+PN3mBrKZygxGrzDHDHSrNiU3ndvnbN2BdUygon6VHJkkkjcX24NysmWXxWwXYBLL0cwfpM4EyFGXkIltEvIp+Ai67TYjLrUjfUKAas0r6TNx6xCugaXvFUb9Q1HBE1EiSTIm/3NJoXA5TesbgO+udifUBVywOavVK/2fGGIqnh9Kc16qOyqCeFcaMB08Syqz/NPWKnlVxqLWrKVS6L/HjidHDuOVaJC9yXeiK1FxEr+Or2B5dQB0uVoAL/iBE/FWNWqcaY5TTz09AvWRtzHpp3/MvN7tm48FkHSmhKHRxds8Ofi24K/ioUA3Hwds+vz8Du4rIY70QaQwfiPZ++PlbzlEUtNwMWVp3ljgHrVyMdu8iPwLGAfr3fRZK7oqWyKtUBNrfKPD7AKUP57+Y5VIHaoFms+4Uzbu4jncDuT1lOj7i8mGIJNBNcvOAmiBCiK16pNoLChG2ndoeOmzpnxYiydQw+9U6l2vJDVQ08VZV18edqbDUdlSi285hQb/6QsNlLz5qFt4ERr8uuM7hwycY9bP/kh5NQLdCoLOwKSS4wk726tPtt5fpbXL6gfMhzVfzDQVekgwHJY5L/4O00xdPVJr+IN35dbHvR4bSUa4QfPDpMCnH2NFcOhnBs/eIm7Cnt2UtvLGYqoHlnvZ68upp4w0mMF0w2jUGqpDLOt1kY/0lrkr6RWpJmCD0R4GYOpczfcFVvY7twdbXK8CaLKLuHA8GiBW/uluztPu1sRULg0pj4RZb4ZYiKIQsumRMuPFDqcmuynASRkYzt3hghVLG4cr1AXwFQYhsbQ8iqY26mO1J91EbCZvHme8hSgigOKbf79w7hvv8R+w9YvDyHAhmd2sdEgqM8ZFlfpROm/gMTnnt3tRPPTY7AE//xLw k/q/LxGt e2AWc60lIx4A0U+KLRE1DmGUS62yVctMsTHvqMr5of8SbC+qbUMj4kMwmy3f5sSm7Xz7PuyZWK8+U5ebPYIiROI5kRXz1n/5VrKCnAC/YKAFAJbItYthUDZrD0EcpsBZ8VLFAmRxdzSD//mEDOqaNfyrRINLkz0qPC6WZkqVV0+vseDvic6My6QizA6M5rhRaY1qghL3bmtuHUSeEKooM60dDhwHe1Lk0x1LhT7bPyTO1wL0= 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: On Thu, Jan 04, 2024 at 07:15:42AM +0100, Christoph Hellwig wrote: > On Wed, Jan 03, 2024 at 03:48:49PM -0800, Darrick J. Wong wrote: > > "To support these cases, a pair of ``xfile_obj_load`` and ``xfile_obj_store`` > > functions are provided to read and persist objects into an xfile. An errors > > encountered here are treated as an out of memory error." > > Ok. > > > > -DEFINE_XFILE_EVENT(xfile_pwrite); > > > +DEFINE_XFILE_EVENT(xfile_obj_load); > > > +DEFINE_XFILE_EVENT(xfile_obj_store); > > > > Want to shorten the names to xfile_load and xfile_store? That's really > > what they're doing anyway. > > Fine with me. Just for the trace points or also for the functions? Might as well do them both, I don't think anyone really depends on those exact names. I don't. :) > Also - returning ENOMEM for the API misuse cases (too large object, > too large total size) always seemed weird to me. Is there a really > strong case for it or should we go for actually useful errors for those? The errors returned by the xfile APIs can float out to userspace, so I'd rather have them all turn into: $ xfs_io -c 'scrub ' / XFS_IOC_SCRUB_METADATA: Cannot allocate memory. vs. $ xfs_io -c 'scrub ' / XFS_IOC_SCRUB_METADATA: File is too large. So that users won't think that the root directory is too big or something. --D