public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: "Ahelenia Ziemiańska" <nabijaczleweli@nabijaczleweli.xyz>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Federico Vaga <federico.vaga@vaga.pv.it>,
	Alex Shi <alexs@kernel.org>, Yanteng Si <siyanteng@loongson.cn>,
	Hu Haowen <src.res@email.cn>,
	Chuck Lever <chuck.lever@oracle.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc-tw-discuss@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v3 13/15] fcntl: remove FASYNC_MAGIC
Date: Fri, 11 Nov 2022 05:00:58 -0500	[thread overview]
Message-ID: <a2409d054aab173dbff062b41b3add1dcd3c9b45.camel@kernel.org> (raw)
In-Reply-To: <756e6016fab23e95d891b6284fbf52184135ee46.1668128257.git.nabijaczleweli@nabijaczleweli.xyz>

On Fri, 2022-11-11 at 02:14 +0100, Ahelenia Ziemiańska wrote:
> 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 <nabijaczleweli@nabijaczleweli.xyz>
> ---
>  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 *);

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2022-11-11 10:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  1:13 [PATCH v3 00/15] magic-number.rst funeral rites Ahelenia Ziemiańska
2022-11-11  1:13 ` [PATCH v3 01/15] hamradio: baycom: remove BAYCOM_MAGIC Ahelenia Ziemiańska
2022-11-11  1:13 ` [PATCH v3 02/15] hamradio: yam: remove YAM_MAGIC Ahelenia Ziemiańska
2022-11-11  1:13 ` [PATCH v3 03/15] pcmcia: synclink_cs: remove MGSLPC_MAGIC Ahelenia Ziemiańska
2022-11-11  1:13 ` [PATCH v3 04/15] pcmcia: synclink_cs: remove dead paranoia_check, warn for missing line Ahelenia Ziemiańska
2022-11-11  1:13 ` [PATCH v3 05/15] coda: remove CODA_MAGIC Ahelenia Ziemiańska
2022-11-11  3:13   ` Jan Harkes
2022-11-11  1:14 ` [PATCH v3 06/15] Documentation: remove PG_MAGIC (not a magic number) Ahelenia Ziemiańska
2022-11-11  1:14 ` [PATCH v3 07/15] Documentation: remove NMI_MAGIC " Ahelenia Ziemiańska
2022-11-11  1:14 ` [PATCH v3 08/15] MIPS: IP27: remove KV_MAGIC Ahelenia Ziemiańska
2022-11-11  5:40   ` Cye Borg
     [not found]   ` <CAD4NMuYU6+JYGwCwDqGW5bTN8Rgg4SwseH9JKzjPAzsujBuCEw@mail.gmail.com>
2022-11-11 13:02     ` Thomas Bogendoerfer
2022-11-11  1:14 ` [PATCH v3 09/15] x86/APM: remove APM_BIOS_MAGIC Ahelenia Ziemiańska
2022-11-11  1:14 ` [PATCH v3 10/15] scsi: acorn: remove QUEUE_MAGIC_{FREE,USED} Ahelenia Ziemiańska
2022-11-11  1:14 ` [PATCH v3 11/15] hdlcdrv: remove HDLCDRV_MAGIC Ahelenia Ziemiańska
2022-11-11  1:14 ` [PATCH v3 12/15] drivers: net: slip: remove SLIP_MAGIC Ahelenia Ziemiańska
2022-11-11  1:14 ` [PATCH v3 13/15] fcntl: remove FASYNC_MAGIC Ahelenia Ziemiańska
2022-11-11 10:00   ` Jeff Layton [this message]
2022-11-11  1:14 ` [PATCH v3 14/15] scsi: ncr53c8xx: replace CCB_MAGIC with bool busy Ahelenia Ziemiańska
2022-11-11  1:14 ` [PATCH v3 15/15] Documentation: remove magic-number.rst Ahelenia Ziemiańska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2409d054aab173dbff062b41b3add1dcd3c9b45.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=alexs@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=corbet@lwn.net \
    --cc=federico.vaga@vaga.pv.it \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc-tw-discuss@lists.sourceforge.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nabijaczleweli@nabijaczleweli.xyz \
    --cc=siyanteng@loongson.cn \
    --cc=src.res@email.cn \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox