From patchwork Tue Nov 1 23:05:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 13961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3263164wru; Tue, 1 Nov 2022 16:09:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7icuuK7y6O9QFSFiXBex45pHUjJgMr/qZTThdr74j1qBXp3sk//mlRbTbmn/bc+oYDQqtJ X-Received: by 2002:a17:90a:de13:b0:213:eab9:5e38 with SMTP id m19-20020a17090ade1300b00213eab95e38mr12130275pjv.44.1667344154883; Tue, 01 Nov 2022 16:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344154; cv=none; d=google.com; s=arc-20160816; b=lsIjcZuy4jUMlL4xgGkMPI0UV3i6uHCaiUP+rdXGnVMWDmzT2iSzY8hq11i4334+T6 NgReezHsmfT7XntW63yNfRx5gcteJ9yPYSmteS06sFzPrzU8ClO6iZEUfnAGzDhKDZDO KvG0sxrO7k0cfb/+4WVbfaXhQo8I/hrmdq77AdpEJVQdzXQswrh0V7t1dWnEgLvEFsDj VSfYeNSRoHInmMIYGdG+OBDPzxvP2YGgVmRn4HRY4EbirtmGjQn13PS2478F0zhRhT1r C6YjbKoTmGOtjIs8UEWvNOjIDHwXUFn12B14TY0fnTgPnbpQvA4R6lehw9xtI3kw+b9F SjGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=6WHt0mtfO1UKQ+KFHwgYrwBFYmEhPVLr+lnSic9AUoM=; b=zw7nAqx/qDzOq6ueIQk/QUY36fdW9oPXJiGqedNECeH+VnKXdYe1v2pQevbyKyE4Df sP2dxh+4QM0ZC1asexvMte4CNV7uwDrMmpebbHei4L8efydrNwh7rcdK653il/22hc39 5Oz3Ba58kcTNPdPBHbubFoMJAtxRa+8JqJICwNXEh9CiaTphDRSDdWoWu27czaEE6APv HMmz3ZpGwWuE9FWyUcS56XPDi+zofwF3JD/EA4QdUVsR+v6GoDSB9FyQmSdCFAXrnh9J M0zXUVQuxA5pUp4/O+WQJ1pdqXLtohCQWLF233dGnfi3uOwVfnkr8OOSzxKLO9LpKyQX VJaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=J7MxYDRL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a170902cacd00b00176e85e5ceasi11666666pld.405.2022.11.01.16.09.02; Tue, 01 Nov 2022 16:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=J7MxYDRL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231437AbiKAXI2 (ORCPT + 99 others); Tue, 1 Nov 2022 19:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231417AbiKAXHS (ORCPT ); Tue, 1 Nov 2022 19:07:18 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CEAE820BEF; Tue, 1 Nov 2022 16:06:00 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 2389F5286; Wed, 2 Nov 2022 00:06:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343960; bh=vmmcp42QtObiMdAlKV6ZcArvn+plUgooLi7XBv1lrRc=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=J7MxYDRLE2v0uq1I1HK225FrXlrWP3CJv4z2yiEKHOMU5v9B/nVVU4s2AVxF1jb8T 340hKkecVNR/xMD9fRJtdGn8vTrerEUS3yATdhhsyX4gxhgBSp2MCVZ0Vu0eM3+M/4 +AKo7pi2VgtElBfTG2dACp5fBCX/yv5lHMltespHc8Dmo51BnAED7DLkH/Rlz+tFY3 4RsjWuOs+4vU0NTRPM9aQK+aUM3cD/h9u1FtKBm3tDKbP0Jfaey++VYbRaIThz/FQO 2Pgfhe4bnDdWVINinco2AEAkahS+JsuEPh42vdC7zlCzw2kFPA/qiaZHIaF/6paGDE g8uv1DcVNkpaxzeeMW+VMscVjg/BT0fS7wO/FQeYotYqIHaMIXkx4JRz1PBaQMYBux xo6TzoFLJuE0RxwTyAE9NUwps3XUu8IMPFbXyTCzDAgC5fc29J9ckR+dd6jwFWQ6dI mNNpBohJi/0pH/9D2QwActVv2Nzys9oo+CkkuhuK4z0nmtHZUR4ek53G1izdBOAxA6 hEjfLlCWi8eYE7McOp49P1wbeXuZtFJcJxzJyXKzVHL/WaKNmqTCrXlDwoPnesuKSC vVOmwHfU4FW+AeE1Tqzs4UdWMMXtGbxjPDdgc6fnkUnNHLcrqfFvSjP0KUGMlD3d6q pCdZ0G7ScEOvyBOv/tXm1hNk= Date: Wed, 2 Nov 2022 00:05:59 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jeff Layton , Chuck Lever , Alexander Viro , Greg Kroah-Hartman , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Subject: [PATCH v2 13/15] fcntl: remove FASYNC_MAGIC Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748337064663941163?= X-GMAIL-MSGID: =?utf-8?q?1748337064663941163?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska --- Documentation/process/magic-number.rst | 1 - Documentation/translations/it_IT/process/magic-number.rst | 1 - Documentation/translations/zh_CN/process/magic-number.rst | 1 - Documentation/translations/zh_TW/process/magic-number.rst | 1 - fs/fcntl.c | 6 ------ include/linux/fs.h | 3 --- 6 files changed, 13 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index e59c707ec785..6e432917a5a8 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -68,6 +68,5 @@ Changelog:: ===================== ================ ======================== ========================================== Magic Name Number Structure File ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 37a539867b6f..7d4c117ac626 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -74,6 +74,5 @@ Registro dei cambiamenti:: ===================== ================ ======================== ========================================== Nome magico Numero Struttura File ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 8a3a3e872c52..c17e3f20440a 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -57,6 +57,5 @@ Linux 魔术数 ===================== ================ ======================== ========================================== 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 7ace7834f7f9..e2eeb74e7192 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -60,6 +60,5 @@ Linux 魔術數 ===================== ================ ======================== ========================================== 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/fs/fcntl.c b/fs/fcntl.c index 146c9ab0cd4b..e366a3804108 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -924,7 +924,6 @@ struct fasync_struct *fasync_insert_entry(int fd, struct file *filp, struct fasy } rwlock_init(&new->fa_lock); - new->magic = FASYNC_MAGIC; new->fa_file = filp; new->fa_fd = fd; new->fa_next = *fapp; @@ -988,11 +987,6 @@ static void kill_fasync_rcu(struct fasync_struct *fa, int sig, int band) struct fown_struct *fown; unsigned long flags; - if (fa->magic != FASYNC_MAGIC) { - printk(KERN_ERR "kill_fasync: bad magic number in " - "fasync_struct!\n"); - return; - } read_lock_irqsave(&fa->fa_lock, flags); if (fa->fa_file) { fown = &fa->fa_file->f_owner; diff --git a/include/linux/fs.h b/include/linux/fs.h index e654435f1651..acfd5db5341a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1345,15 +1345,12 @@ static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) struct fasync_struct { rwlock_t fa_lock; - int magic; int fa_fd; struct fasync_struct *fa_next; /* singly linked list */ struct file *fa_file; struct rcu_head fa_rcu; }; -#define FASYNC_MAGIC 0x4601 - /* SMP safe fasync helpers: */ extern int fasync_helper(int, struct file *, int, struct fasync_struct **); extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);