Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .container_build_image
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rocky-10-kernel-builder
4 changes: 2 additions & 2 deletions .github/workflows/build-check_aarch64-rt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-aarch64-rt-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/build-check_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-aarch64-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/build-check_x86_64-rt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-x86_64-rt-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/build-check_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-x86_64-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
11 changes: 11 additions & 0 deletions .github/workflows/kernel-build-and-test-multiarch-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Trigger Automated kernel build and test (multi-arch)

on:
push:
branches:
- '*_rlc-10/**'

jobs:
kernelCI:
uses: ctrliq/kernel-src-tree/.github/workflows/kernel-build-and-test-multiarch-trigger.yml@main
secrets: inherit
18 changes: 12 additions & 6 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,15 @@ struct dentry *d_find_alias_rcu(struct inode *inode)
return de;
}

void d_dispose_if_unused(struct dentry *dentry, struct list_head *dispose)
{
spin_lock(&dentry->d_lock);
if (!dentry->d_lockref.count)
to_shrink_list(dentry, dispose);
spin_unlock(&dentry->d_lock);
}
EXPORT_SYMBOL(d_dispose_if_unused);

/*
* Try to kill dentries associated with this inode.
* WARNING: you must own a reference to inode.
Expand All @@ -1042,12 +1051,8 @@ void d_prune_aliases(struct inode *inode)
struct dentry *dentry;

spin_lock(&inode->i_lock);
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
spin_lock(&dentry->d_lock);
if (!dentry->d_lockref.count)
to_shrink_list(dentry, &dispose);
spin_unlock(&dentry->d_lock);
}
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias)
d_dispose_if_unused(dentry, &dispose);
spin_unlock(&inode->i_lock);
shrink_dentry_list(&dispose);
}
Expand Down Expand Up @@ -1087,6 +1092,7 @@ void shrink_dentry_list(struct list_head *list)
shrink_kill(dentry);
}
}
EXPORT_SYMBOL(shrink_dentry_list);

static enum lru_status dentry_lru_isolate(struct list_head *item,
struct list_lru_one *lru, void *arg)
Expand Down
33 changes: 32 additions & 1 deletion fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/swap.h>
#include <linux/splice.h>
#include <linux/sched.h>
#include <linux/seq_file.h>

#define CREATE_TRACE_POINTS
#include "fuse_trace.h"
Expand Down Expand Up @@ -1887,6 +1888,19 @@ static int fuse_notify_resend(struct fuse_conn *fc)
return 0;
}

/*
* Increments the fuse connection epoch. This will result of dentries from
* previous epochs to be invalidated.
*
* XXX optimization: add call to shrink_dcache_sb()?
*/
static int fuse_notify_inc_epoch(struct fuse_conn *fc)
{
atomic_inc(&fc->epoch);

return 0;
}

static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
unsigned int size, struct fuse_copy_state *cs)
{
Expand Down Expand Up @@ -1915,6 +1929,9 @@ static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
case FUSE_NOTIFY_RESEND:
return fuse_notify_resend(fc);

case FUSE_NOTIFY_INC_EPOCH:
return fuse_notify_inc_epoch(fc);

default:
fuse_copy_finish(cs);
return -EINVAL;
Expand Down Expand Up @@ -1989,7 +2006,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
*/
if (!oh.unique) {
err = fuse_notify(fc, oh.error, nbytes - sizeof(oh), cs);
goto out;
goto copy_finish;
}

err = -EINVAL;
Expand Down Expand Up @@ -2453,6 +2470,17 @@ static long fuse_dev_ioctl(struct file *file, unsigned int cmd,
}
}

#ifdef CONFIG_PROC_FS
static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)
{
struct fuse_dev *fud = fuse_get_dev(file);
if (!fud)
return;

seq_printf(seq, "fuse_connection:\t%u\n", fud->fc->dev);
}
#endif

const struct file_operations fuse_dev_operations = {
.owner = THIS_MODULE,
.open = fuse_dev_open,
Expand All @@ -2465,6 +2493,9 @@ const struct file_operations fuse_dev_operations = {
.fasync = fuse_dev_fasync,
.unlocked_ioctl = fuse_dev_ioctl,
.compat_ioctl = compat_ptr_ioctl,
#ifdef CONFIG_PROC_FS
.show_fdinfo = fuse_dev_show_fdinfo,
#endif
};
EXPORT_SYMBOL_GPL(fuse_dev_operations);

Expand Down
26 changes: 22 additions & 4 deletions fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,14 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
struct inode *inode;
struct dentry *parent;
struct fuse_mount *fm;
struct fuse_conn *fc;
struct fuse_inode *fi;
int ret;

fc = get_fuse_conn_super(entry->d_sb);
if (entry->d_time < atomic_read(&fc->epoch))
goto invalid;

inode = d_inode_rcu(entry);
if (inode && fuse_is_bad(inode))
goto invalid;
Expand Down Expand Up @@ -415,16 +420,20 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
unsigned int flags)
{
int err;
struct fuse_entry_out outarg;
struct fuse_conn *fc;
struct inode *inode;
struct dentry *newent;
int err, epoch;
bool outarg_valid = true;
bool locked;

if (fuse_is_bad(dir))
return ERR_PTR(-EIO);

fc = get_fuse_conn_super(dir->i_sb);
epoch = atomic_read(&fc->epoch);

locked = fuse_lock_inode(dir);
err = fuse_lookup_name(dir->i_sb, get_node_id(dir), &entry->d_name,
&outarg, &inode);
Expand All @@ -446,6 +455,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
goto out_err;

entry = newent ? newent : entry;
entry->d_time = epoch;
if (outarg_valid)
fuse_change_entry_timeout(entry, &outarg);
else
Expand Down Expand Up @@ -618,7 +628,6 @@ static int fuse_create_open(struct mnt_idmap *idmap, struct inode *dir,
struct dentry *entry, struct file *file,
unsigned int flags, umode_t mode, u32 opcode)
{
int err;
struct inode *inode;
struct fuse_mount *fm = get_fuse_mount(dir);
FUSE_ARGS(args);
Expand All @@ -628,11 +637,13 @@ static int fuse_create_open(struct mnt_idmap *idmap, struct inode *dir,
struct fuse_entry_out outentry;
struct fuse_inode *fi;
struct fuse_file *ff;
int epoch, err;
bool trunc = flags & O_TRUNC;

/* Userspace expects S_IFREG in create mode */
BUG_ON((mode & S_IFMT) != S_IFREG);

epoch = atomic_read(&fm->fc->epoch);
forget = fuse_alloc_forget();
err = -ENOMEM;
if (!forget)
Expand Down Expand Up @@ -701,6 +712,7 @@ static int fuse_create_open(struct mnt_idmap *idmap, struct inode *dir,
}
kfree(forget);
d_instantiate(entry, inode);
entry->d_time = epoch;
fuse_change_entry_timeout(entry, &outentry);
fuse_dir_changed(dir);
err = generic_file_open(inode, file);
Expand Down Expand Up @@ -787,12 +799,14 @@ static int create_new_entry(struct mnt_idmap *idmap, struct fuse_mount *fm,
struct fuse_entry_out outarg;
struct inode *inode;
struct dentry *d;
int err;
struct fuse_forget_link *forget;
int epoch, err;

if (fuse_is_bad(dir))
return -EIO;

epoch = atomic_read(&fm->fc->epoch);

forget = fuse_alloc_forget();
if (!forget)
return -ENOMEM;
Expand Down Expand Up @@ -835,9 +849,11 @@ static int create_new_entry(struct mnt_idmap *idmap, struct fuse_mount *fm,
return PTR_ERR(d);

if (d) {
d->d_time = epoch;
fuse_change_entry_timeout(d, &outarg);
dput(d);
} else {
entry->d_time = epoch;
fuse_change_entry_timeout(entry, &outarg);
}
fuse_dir_changed(dir);
Expand Down Expand Up @@ -1632,7 +1648,7 @@ static const char *fuse_get_link(struct dentry *dentry, struct inode *inode,
goto out_err;

if (fc->cache_symlinks)
return page_get_link(dentry, inode, callback);
return page_get_link_raw(dentry, inode, callback);

err = -ECHILD;
if (!dentry)
Expand Down Expand Up @@ -1680,6 +1696,8 @@ static int fuse_dir_open(struct inode *inode, struct file *file)
*/
if (ff->open_flags & (FOPEN_STREAM | FOPEN_NONSEEKABLE))
nonseekable_open(inode, file);
if (!(ff->open_flags & FOPEN_KEEP_CACHE))
invalidate_inode_pages2(inode->i_mapping);
}

return err;
Expand Down
3 changes: 3 additions & 0 deletions fs/fuse/fuse_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ struct fuse_conn {
/** Number of fuse_dev's */
atomic_t dev_count;

/** Current epoch for up-to-date dentries */
atomic_t epoch;

struct rcu_head rcu;

/** The user id for this mount */
Expand Down
1 change: 1 addition & 0 deletions fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ void fuse_conn_init(struct fuse_conn *fc, struct fuse_mount *fm,
init_rwsem(&fc->killsb);
refcount_set(&fc->count, 1);
atomic_set(&fc->dev_count, 1);
atomic_set(&fc->epoch, 1);
init_waitqueue_head(&fc->blocked_waitq);
fuse_iqueue_init(&fc->iq, fiq_ops, fiq_priv);
INIT_LIST_HEAD(&fc->bg_queue);
Expand Down
3 changes: 3 additions & 0 deletions fs/fuse/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static int fuse_direntplus_link(struct file *file,
struct fuse_conn *fc;
struct inode *inode;
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
int epoch;

if (!o->nodeid) {
/*
Expand Down Expand Up @@ -190,6 +191,7 @@ static int fuse_direntplus_link(struct file *file,
return -EIO;

fc = get_fuse_conn(dir);
epoch = atomic_read(&fc->epoch);

name.hash = full_name_hash(parent, name.name, name.len);
dentry = d_lookup(parent, &name);
Expand Down Expand Up @@ -256,6 +258,7 @@ static int fuse_direntplus_link(struct file *file,
}
if (fc->readdirplus_auto)
set_bit(FUSE_I_INIT_RDPLUS, &get_fuse_inode(inode)->state);
dentry->d_time = epoch;
fuse_change_entry_timeout(dentry, o);

dput(dentry);
Expand Down
24 changes: 19 additions & 5 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -5334,10 +5334,9 @@ const char *vfs_get_link(struct dentry *dentry, struct delayed_call *done)
EXPORT_SYMBOL(vfs_get_link);

/* get the link contents into pagecache */
const char *page_get_link(struct dentry *dentry, struct inode *inode,
struct delayed_call *callback)
static char *__page_get_link(struct dentry *dentry, struct inode *inode,
struct delayed_call *callback)
{
char *kaddr;
struct page *page;
struct address_space *mapping = inode->i_mapping;

Expand All @@ -5356,8 +5355,23 @@ const char *page_get_link(struct dentry *dentry, struct inode *inode,
}
set_delayed_call(callback, page_put_link, page);
BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM);
kaddr = page_address(page);
nd_terminate_link(kaddr, inode->i_size, PAGE_SIZE - 1);
return page_address(page);
}

const char *page_get_link_raw(struct dentry *dentry, struct inode *inode,
struct delayed_call *callback)
{
return __page_get_link(dentry, inode, callback);
}
EXPORT_SYMBOL_GPL(page_get_link_raw);

const char *page_get_link(struct dentry *dentry, struct inode *inode,
struct delayed_call *callback)
{
char *kaddr = __page_get_link(dentry, inode, callback);

if (!IS_ERR(kaddr))
nd_terminate_link(kaddr, inode->i_size, PAGE_SIZE - 1);
return kaddr;
}

Expand Down
2 changes: 2 additions & 0 deletions include/linux/dcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ extern void d_tmpfile(struct file *, struct inode *);

extern struct dentry *d_find_alias(struct inode *);
extern void d_prune_aliases(struct inode *);
extern void d_dispose_if_unused(struct dentry *, struct list_head *);
extern void shrink_dentry_list(struct list_head *);

extern struct dentry *d_find_alias_rcu(struct inode *);

Expand Down
Loading