From patchwork Mon Jan 29 14:34:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13535761 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 8CD94C47422 for ; Mon, 29 Jan 2024 14:35:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EBB96B009C; Mon, 29 Jan 2024 09:35:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 178D56B009F; Mon, 29 Jan 2024 09:35:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E943E6B00A5; Mon, 29 Jan 2024 09:35:21 -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 CD0136B00A3 for ; Mon, 29 Jan 2024 09:35:21 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A72F1A19C6 for ; Mon, 29 Jan 2024 14:35:21 +0000 (UTC) X-FDA: 81732596442.22.45FC89E Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf03.hostedemail.com (Postfix) with ESMTP id EF6D520005 for ; Mon, 29 Jan 2024 14:35:19 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=tZh4RayM; spf=none (imf03.hostedemail.com: domain of BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706538920; 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=m8bNau9njavlNFAZK08RacrmSpqtfTJnRVvJoaaL3Z8=; b=hQdZFmnkQ+dSxLL2lXz5iBh4l14zyv64JXDob+fdP/wue1VCUreB/6rKXx+mmHq4wI7W8X IixgNVsaCiQH+2Sz4f35qhlF46/xMIzeobdO44mzuPYfmNQECBc2Q/6CL/vtjhTq/kxbXh K19x37gtiYn3cpMKfE2tQy7D/HZ5+5o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706538920; a=rsa-sha256; cv=none; b=y4c6zpBH2NU3ppUUs4/8XU6ewWlFllb1k/0C7nm8ovvsCAd3Jg+6bWsPko3RGDvk5by+hW Mfra+IQ+tmKt/dbfwXJPmzlnbSozQUnURI5c+B74/1z4Fag7kGn8id486l1UdGHJZH/wcN 854ADcuV/xwxdwqvGylqioLwOSB93Dw= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=tZh4RayM; spf=none (imf03.hostedemail.com: domain of BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=m8bNau9njavlNFAZK08RacrmSpqtfTJnRVvJoaaL3Z8=; b=tZh4RayMLGDoQRkvd8Hg0t+1Kv I48W9YLDAjraY8q9ek8/PmGGt0ycArACUm7FRgz74BLRwh8nyQR3jL09fw7Re5UstEhSLvSvLopvb zPzfJ4gUy6/2S8uZD5ChkpaRNEOQ4qE325YSzD5fexgdt8hoxfsyPIzgmaeZR+UFlo1BdiZJh2Gbc nz3v/spFo/dYrhPH1p8CoWFWf29nSZAA8G3YLoFJiWOzlhIHnrEGubomA5xm71S/mlCp1we6ZP5fP Ay739fM3+N+Y4zjkTWojQeFoQ8kxoiwsDevwbqRJv7xSVd2DchMNqpbjrFNRa9gETU1jh+wfzMyg9 meCkoVgg==; Received: from [2001:4bb8:182:6550:c70:4a89:bc61:3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUSjE-0000000D66L-0Tvd; Mon, 29 Jan 2024 14:35:16 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: linux-xfs@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox Subject: [PATCH 03/20] shmem: set a_ops earlier in shmem_symlink Date: Mon, 29 Jan 2024 15:34:45 +0100 Message-Id: <20240129143502.189370-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129143502.189370-1-hch@lst.de> References: <20240129143502.189370-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: EF6D520005 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 3j1coondg1z5fbi46jqhqyry71aiot69 X-HE-Tag: 1706538919-631012 X-HE-Meta: U2FsdGVkX1+atY89j96Ifd8T7ny9oSBacVmtIfY8yfHxQqK6ipeVFMI9WXjJ3IH/GqOz0fZRgTmBpFIvkQ0r0et8xUQrPukoKsteXYOxlJgf/m8ICAmU8dZI1o0X21wfmc58VYsBCd0s41FJq1nZtQfAgETy0tfSn1W9RpKyO6doSX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3K7tm3DwYZqRu/5r//JZnvUl3eHUPKaO17mGvoaTl9dLIKvCHibGABuQy0HSezYTlzaoiIaFWJ8xnqaJ6MsnVmosKzuIcrwOSIO0LqR0mOifcDDJpxMBFwQ6qvMkRVOgM+c3zyIMJzn3MBdzlOrWFjRUQkJLzGhyAYKcGfiTbZlc3kAGBxFdUJYDnAyrx5qmG0Hhld+xpZij9QRPwNgvTcIhkEau10ie8LjUWTU6YkhJn2GMMekRDPA3pNV1Ibf3t7vgkFNymBKuQkVi1vUxATY= 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: Set the a_ops in shmem_symlink before reading a folio from the mapping to prepare for asserting that shmem_get_folio is only called on shmem mappings. Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index f607b0cab7e4e2..1900916aa84d13 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3506,10 +3506,10 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, inode->i_op = &shmem_short_symlink_operations; } else { inode_nohighmem(inode); + inode->i_mapping->a_ops = &shmem_aops; error = shmem_get_folio(inode, 0, &folio, SGP_WRITE); if (error) goto out_remove_offset; - inode->i_mapping->a_ops = &shmem_aops; inode->i_op = &shmem_symlink_inode_operations; memcpy(folio_address(folio), symname, len); folio_mark_uptodate(folio);