From 5bf1ddf7ee0e23598a620ef9ea2b0f00e804859d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 9 Mar 2018 18:06:03 -0500 Subject: lustre: get rid of pointless casts to struct dentry * ... when feeding const struct dentry * to primitives taking exactly that. Signed-off-by: Al Viro --- drivers/staging/lustre/lustre/llite/dcache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index 549369739d80..6cd0318062e8 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -90,7 +90,7 @@ static int ll_dcompare(const struct dentry *dentry, d_count(dentry)); /* mountpoint is always valid */ - if (d_mountpoint((struct dentry *)dentry)) + if (d_mountpoint(dentry)) return 0; if (d_lustre_invalid(dentry)) @@ -111,7 +111,7 @@ static int ll_ddelete(const struct dentry *de) LASSERT(de); CDEBUG(D_DENTRY, "%s dentry %pd (%p, parent %p, inode %p) %s%s\n", - d_lustre_invalid((struct dentry *)de) ? "deleting" : "keeping", + d_lustre_invalid(de) ? "deleting" : "keeping", de, de, de->d_parent, d_inode(de), d_unhashed(de) ? "" : "hashed,", list_empty(&de->d_subdirs) ? "" : "subdirs"); @@ -119,7 +119,7 @@ static int ll_ddelete(const struct dentry *de) /* kernel >= 2.6.38 last refcount is decreased after this function. */ LASSERT(d_count(de) == 1); - if (d_lustre_invalid((struct dentry *)de)) + if (d_lustre_invalid(de)) return 1; return 0; } -- cgit v1.3-18-gd494 From a7498968338da9b928f5d8054acc8be6ed2bc14c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 10 Mar 2018 16:40:33 -0500 Subject: oprofilefs: don't oops on allocation failure ... just short-circuit the creation of potential children Signed-off-by: Al Viro --- drivers/oprofile/oprofilefs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index d77ebbfc67c9..4ea08979312c 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c @@ -138,6 +138,9 @@ static int __oprofilefs_create_file(struct dentry *root, char const *name, struct dentry *dentry; struct inode *inode; + if (!root) + return -ENOMEM; + inode_lock(d_inode(root)); dentry = d_alloc_name(root, name); if (!dentry) { -- cgit v1.3-18-gd494