mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-07 18:50:33 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28924df2a0 | ||
|
|
c297ed90fb | ||
|
|
f06c2d26d1 | ||
|
|
a7c1290eef | ||
|
|
aadea57f53 | ||
|
|
ae9464c65e |
@@ -416,6 +416,15 @@ static void configfs_remove_dir(struct dentry *d)
|
||||
if (d_really_is_positive(d)) {
|
||||
if (unlikely(simple_rmdir(d_inode(parent), d)))
|
||||
pr_warn("remove_dir (%pd): attributes remain", d);
|
||||
else
|
||||
/*
|
||||
* configfs_get_config_item() takes a hashed dentry as
|
||||
* proof that ->s_element is still alive. Our caller
|
||||
* is about to drop the last reference to the item and
|
||||
* the VFS will not unhash until after we return, so
|
||||
* unhash it here.
|
||||
*/
|
||||
d_drop(d);
|
||||
}
|
||||
|
||||
pr_debug(" o %pd removing done (%d)\n", d, d_count(d));
|
||||
|
||||
@@ -76,9 +76,9 @@ static int configfs_get_target_path(struct config_item *item,
|
||||
|
||||
static int create_link(struct config_item *parent_item,
|
||||
struct config_item *item,
|
||||
struct configfs_dirent *target_sd,
|
||||
struct dentry *dentry)
|
||||
{
|
||||
struct configfs_dirent *target_sd = item->ci_dentry->d_fsdata;
|
||||
char *body;
|
||||
int ret;
|
||||
|
||||
@@ -115,6 +115,7 @@ static int create_link(struct config_item *parent_item,
|
||||
|
||||
|
||||
static int get_target(const char *symname, struct config_item **target,
|
||||
struct configfs_dirent **target_sd,
|
||||
struct super_block *sb)
|
||||
{
|
||||
struct path path __free(path_put) = {};
|
||||
@@ -125,7 +126,20 @@ static int get_target(const char *symname, struct config_item **target,
|
||||
return ret;
|
||||
if (path.dentry->d_sb != sb)
|
||||
return -EPERM;
|
||||
*target = configfs_get_config_item(path.dentry);
|
||||
/*
|
||||
* A hashed dentry guarantees that neither the item nor the dirent
|
||||
* have been released yet, as removals unhash before dropping.
|
||||
* Grab both references here. An item reference alone would not keep
|
||||
* ->ci_dentry alive.
|
||||
*/
|
||||
spin_lock(&path.dentry->d_lock);
|
||||
if (!d_unhashed(path.dentry)) {
|
||||
struct configfs_dirent *sd = path.dentry->d_fsdata;
|
||||
|
||||
*target = config_item_get(sd->s_element);
|
||||
*target_sd = configfs_get(sd);
|
||||
}
|
||||
spin_unlock(&path.dentry->d_lock);
|
||||
if (!*target)
|
||||
return -ENOENT;
|
||||
return 0;
|
||||
@@ -139,6 +153,7 @@ int configfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
|
||||
struct configfs_dirent *sd;
|
||||
struct config_item *parent_item;
|
||||
struct config_item *target_item = NULL;
|
||||
struct configfs_dirent *target_sd = NULL;
|
||||
const struct config_item_type *type;
|
||||
|
||||
sd = dentry->d_parent->d_fsdata;
|
||||
@@ -182,7 +197,7 @@ int configfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
|
||||
* AV, a thoroughly annoyed bastard.
|
||||
*/
|
||||
inode_unlock(dir);
|
||||
ret = get_target(symname, &target_item, dentry->d_sb);
|
||||
ret = get_target(symname, &target_item, &target_sd, dentry->d_sb);
|
||||
inode_lock(dir);
|
||||
if (ret)
|
||||
goto out_put;
|
||||
@@ -196,13 +211,14 @@ int configfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
|
||||
ret = type->ct_item_ops->allow_link(parent_item, target_item);
|
||||
if (!ret) {
|
||||
mutex_lock(&configfs_symlink_mutex);
|
||||
ret = create_link(parent_item, target_item, dentry);
|
||||
ret = create_link(parent_item, target_item, target_sd, dentry);
|
||||
mutex_unlock(&configfs_symlink_mutex);
|
||||
if (ret && type->ct_item_ops->drop_link)
|
||||
type->ct_item_ops->drop_link(parent_item,
|
||||
target_item);
|
||||
}
|
||||
|
||||
configfs_put(target_sd);
|
||||
config_item_put(target_item);
|
||||
|
||||
out_put:
|
||||
|
||||
@@ -196,7 +196,7 @@ static int powerpc_vpadtl_sample(struct powerpc_vpadtl_entry *record,
|
||||
sample.cpumode = PERF_RECORD_MISC_KERNEL;
|
||||
sample.time = save;
|
||||
sample.raw_data = record;
|
||||
sample.raw_size = sizeof(record);
|
||||
sample.raw_size = sizeof(*record);
|
||||
event.sample.header.type = PERF_RECORD_SAMPLE;
|
||||
event.sample.header.misc = sample.cpumode;
|
||||
event.sample.header.size = sizeof(struct perf_event_header);
|
||||
|
||||
@@ -1947,7 +1947,16 @@ int dso__load(struct dso *dso, struct map *map)
|
||||
if (next_slot) {
|
||||
ss_pos++;
|
||||
|
||||
if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND)
|
||||
/*
|
||||
* The binary type is used to find the file containing
|
||||
* the executed instructions, so prefer the types that
|
||||
* refer to the actual object over debug-only files such
|
||||
* as DSO_BINARY_TYPE__DEBUGLINK.
|
||||
*/
|
||||
if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND ||
|
||||
symtab_type == DSO_BINARY_TYPE__BUILD_ID_CACHE ||
|
||||
(symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_DSO &&
|
||||
dso__binary_type(dso) != DSO_BINARY_TYPE__BUILD_ID_CACHE))
|
||||
dso__set_binary_type(dso, symtab_type);
|
||||
|
||||
if (syms_ss && runtime_ss)
|
||||
|
||||
Reference in New Issue
Block a user