Skip to content
Open
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
6 changes: 4 additions & 2 deletions arch/arm64/kvm/at.c
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,8 @@ void __kvm_at_s12(struct kvm_vcpu *vcpu, u32 op, u64 vaddr)
/* Do the stage-2 translation */
ipa = (par & GENMASK_ULL(47, 12)) | (vaddr & GENMASK_ULL(11, 0));
out.esr = 0;
ret = kvm_walk_nested_s2(vcpu, ipa, &out);
scoped_guard(srcu, &vcpu->kvm->srcu)
ret = kvm_walk_nested_s2(vcpu, ipa, &out);
if (ret < 0)
return;

Expand Down Expand Up @@ -1623,7 +1624,8 @@ int __kvm_find_s1_desc_level(struct kvm_vcpu *vcpu, u64 va, u64 ipa, int *level)
}

/* Walk the guest's PT, looking for a match along the way */
ret = walk_s1(vcpu, &wi, &wr, va);
scoped_guard(srcu, &vcpu->kvm->srcu)
ret = walk_s1(vcpu, &wi, &wr, va);
switch (ret) {
case -EINTR:
/* We interrupted the walk on a match, return the level */
Expand Down
33 changes: 20 additions & 13 deletions arch/arm64/kvm/nested.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,28 @@ int kvm_vcpu_init_nested(struct kvm_vcpu *vcpu)
* again, and there is no reason to affect the whole VM for this.
*/
num_mmus = atomic_read(&kvm->online_vcpus) * S2_MMU_PER_VCPU;
tmp = kvrealloc(kvm->arch.nested_mmus,
size_mul(sizeof(*kvm->arch.nested_mmus), num_mmus),
GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!tmp)
return -ENOMEM;

swap(kvm->arch.nested_mmus, tmp);
if (num_mmus > kvm->arch.nested_mmus_size) {
tmp = kvcalloc(num_mmus, sizeof(*tmp), GFP_KERNEL_ACCOUNT);
if (!tmp)
return -ENOMEM;

/*
* If we went through a realocation, adjust the MMU back-pointers in
* the previously initialised kvm_pgtable structures.
*/
if (kvm->arch.nested_mmus != tmp)
for (int i = 0; i < kvm->arch.nested_mmus_size; i++)
kvm->arch.nested_mmus[i].pgt->mmu = &kvm->arch.nested_mmus[i];
write_lock(&kvm->mmu_lock);

if (kvm->arch.nested_mmus_size) {
memcpy(tmp, kvm->arch.nested_mmus,
size_mul(sizeof(*tmp), kvm->arch.nested_mmus_size));

for (int i = 0; i < kvm->arch.nested_mmus_size; i++)
tmp[i].pgt->mmu = &tmp[i];
}

swap(kvm->arch.nested_mmus, tmp);

write_unlock(&kvm->mmu_lock);

kvfree(tmp);
}

for (int i = kvm->arch.nested_mmus_size; !ret && i < num_mmus; i++)
ret = init_nested_s2_mmu(kvm, &kvm->arch.nested_mmus[i]);
Expand Down
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
Loading