diff options
| author | Christian Brauner <[email protected]> | 2025-07-02 09:23:55 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2025-07-02 12:41:39 +0000 |
| commit | 1e7ab6f67824343ee3e96f100f0937c393749a8a (patch) | |
| tree | b9f8da8dd1870bdde04e43edcdbcbdb6ebbeaa95 /fs/libfs.c | |
| parent | Merge patch series "netfs, cifs: Fixes to retry-related code" (diff) | |
| download | kernel-1e7ab6f67824343ee3e96f100f0937c393749a8a.tar.gz kernel-1e7ab6f67824343ee3e96f100f0937c393749a8a.zip | |
anon_inode: rework assertions
Making anonymous inodes regular files comes with a lot of risk and
regression potential as evidenced by a recent hickup in io_uring. We're
better of continuing to not have them be regular files. Since we have
S_ANON_INODE we can port all of our assertions easily.
Link: https://lore.kernel.org/[email protected]
Fixes: cfd86ef7e8e7 ("anon_inode: use a proper mode internally")
Acked-by: Jens Axboe <[email protected]>
Cc: [email protected]
Reported-by: Jens Axboe <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/libfs.c')
| -rw-r--r-- | fs/libfs.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/libfs.c b/fs/libfs.c index 9ea0ecc325a8..6f487fc6be34 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -1649,12 +1649,10 @@ struct inode *alloc_anon_inode(struct super_block *s) */ inode->i_state = I_DIRTY; /* - * Historically anonymous inodes didn't have a type at all and - * userspace has come to rely on this. Internally they're just - * regular files but S_IFREG is masked off when reporting - * information to userspace. + * Historically anonymous inodes don't have a type at all and + * userspace has come to rely on this. */ - inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR; + inode->i_mode = S_IRUSR | S_IWUSR; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); inode->i_flags |= S_PRIVATE | S_ANON_INODE; |
