[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops
From:       Tetsuo Handa <penguin-kernel () I-love ! SAKURA ! ne ! jp>
Date:       2024-05-02 16:42:12
Message-ID: b13ab60e-503a-4c11-8a99-0ccccce33c6c () I-love ! SAKURA ! ne ! jp
[Download RAW message or body]

On 2024/05/02 23:14, Marco Elver wrote:
> I sent a patch to add the type qualifier - in a simple test I added it
> does what we want:
> https://lore.kernel.org/all/20240502141242.2765090-1-elver@google.com/T/#u

Want some updates to Documentation/process/volatile-considered-harmful.rst
because __data_racy is for patches to add volatile variables ?

  Patches to remove volatile variables are generally welcome - as long as
  they come with a justification which shows that the concurrency issues have
  been properly thought through.

> 
> I'll leave it to Tetsuo to amend the original patch if __data_racy makes sense.

OK if below change is acceptable.

--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1012,7 +1012,7 @@ struct file {
        struct file_ra_state    f_ra;
        struct path             f_path;
        struct inode            *f_inode;       /* cached value */
-       const struct file_operations    *f_op;
+       const __data_racy struct file_operations   *f_op;

        u64                     f_version;
 #ifdef CONFIG_SECURITY

Hmm, debugfs assumes that f_op does not change?

fs/debugfs/file.c: In function 'full_proxy_release':
fs/debugfs/file.c:357:45: warning: initialization discards 'volatile' qualifier from \
pointer target type [-Wdiscarded-qualifiers]  const struct file_operations \
*proxy_fops = filp->f_op;  ^~~~


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic