* [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
@ 2021-05-09 23:33 wenhuizhang
2021-05-11 16:32 ` Aurélien Aptel
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: wenhuizhang @ 2021-05-09 23:33 UTC (permalink / raw)
Cc: wenhui, Steve French, linux-cifs, samba-technical, linux-kernel
Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group).
line 741 struct cifsInodeInfo *cinode;
line 747 cinode = CIFS_I(d_inode(cfile->dentry));
could be deleted.
Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
cinode on filesystem should not be deleted when files are closed, they are representations of some data fields on a physical disk, thus no further action is required.
The virtual inode on vfs will be handled by vfs automatically, and the denotation is inode, which is different from the cinode.
---
fs/cifs/misc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 524dbdfb7184..801a5300f765 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -738,13 +738,11 @@ void
cifs_close_all_deferred_files(struct cifs_tcon *tcon)
{
struct cifsFileInfo *cfile;
- struct cifsInodeInfo *cinode;
struct list_head *tmp;
spin_lock(&tcon->open_file_lock);
list_for_each(tmp, &tcon->openFileList) {
cfile = list_entry(tmp, struct cifsFileInfo, tlist);
- cinode = CIFS_I(d_inode(cfile->dentry));
if (delayed_work_pending(&cfile->deferred))
mod_delayed_work(deferredclose_wq, &cfile->deferred, 0);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
2021-05-09 23:33 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
@ 2021-05-11 16:32 ` Aurélien Aptel
[not found] ` <CAOSEQ1p80+JemJkj975ZTt5xw4XCPtOf2uBEvQs9RfW4UkDWXg@mail.gmail.com>
2021-05-11 22:34 ` [PATCH] Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group) wenhuizhang
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Aurélien Aptel @ 2021-05-11 16:32 UTC (permalink / raw)
To: wenhuizhang
Cc: wenhui, Steve French, linux-cifs, samba-technical, linux-kernel
wenhuizhang <wenhui@gwmail.gwu.edu> writes:
> Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group).
>
> line 741 struct cifsInodeInfo *cinode;
> line 747 cinode = CIFS_I(d_inode(cfile->dentry));
> could be deleted.
>
> Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
>
> cinode on filesystem should not be deleted when files are closed, they are representations of some data fields on a physical disk, thus no further action is required.
> The virtual inode on vfs will be handled by vfs automatically, and the denotation is inode, which is different from the cinode.
This looks ok but the patch subject is wrong.
Also the signed-off tag should be the last thing in the commit msg.
Cheers,
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group)
2021-05-09 23:33 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
2021-05-11 16:32 ` Aurélien Aptel
@ 2021-05-11 22:34 ` wenhuizhang
2021-05-12 9:38 ` Aurélien Aptel
2021-05-13 16:53 ` [PATCH] cifs: deadstore delete in deferred files wenhuizhang
2021-05-13 16:55 ` [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files() wenhuizhang
3 siblings, 1 reply; 11+ messages in thread
From: wenhuizhang @ 2021-05-11 22:34 UTC (permalink / raw)
Cc: wenhuizhang, Steve French, linux-cifs, samba-technical, linux-kernel
Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group).
line 741 struct cifsInodeInfo *cinode;
line 747 cinode = CIFS_I(d_inode(cfile->dentry));
could be deleted.
cinode on filesystem should not be deleted when files are closed, they are representations of some data fields on a physical disk, thus no further action is required.
The virtual inode on vfs will be handled by vfs automatically, and the denotation is inode, which is different from the cinode.
Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
---
fs/cifs/misc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 524dbdfb7184..801a5300f765 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -738,13 +738,11 @@ void
cifs_close_all_deferred_files(struct cifs_tcon *tcon)
{
struct cifsFileInfo *cfile;
- struct cifsInodeInfo *cinode;
struct list_head *tmp;
spin_lock(&tcon->open_file_lock);
list_for_each(tmp, &tcon->openFileList) {
cfile = list_entry(tmp, struct cifsFileInfo, tlist);
- cinode = CIFS_I(d_inode(cfile->dentry));
if (delayed_work_pending(&cfile->deferred))
mod_delayed_work(deferredclose_wq, &cfile->deferred, 0);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group)
2021-05-11 22:34 ` [PATCH] Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group) wenhuizhang
@ 2021-05-12 9:38 ` Aurélien Aptel
0 siblings, 0 replies; 11+ messages in thread
From: Aurélien Aptel @ 2021-05-12 9:38 UTC (permalink / raw)
To: wenhuizhang
Cc: wenhuizhang, Steve French, linux-cifs, samba-technical, linux-kernel
wenhuizhang <wenhui@gwmail.gwu.edu> writes:
> Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group).
>
> line 741 struct cifsInodeInfo *cinode;
> line 747 cinode = CIFS_I(d_inode(cfile->dentry));
> could be deleted.
>
> cinode on filesystem should not be deleted when files are closed, they are representations of some data fields on a physical disk, thus no further action is required.
> The virtual inode on vfs will be handled by vfs automatically, and the denotation is inode, which is different from the cinode.
>
> Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
That's better but:
* the subject (first line of commit msg) should be about what the patch
actually does, usally with a prefix of the subsystem. So for example:
cifs: remove deadstore in cifs_close_all_deferred_files()
* the body of the commit msg should be wrapped around 80 cols to avoid
long lines unless you are quoting some output or urls
Cheers,
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] cifs: deadstore delete in deferred files
2021-05-09 23:33 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
2021-05-11 16:32 ` Aurélien Aptel
2021-05-11 22:34 ` [PATCH] Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group) wenhuizhang
@ 2021-05-13 16:53 ` wenhuizhang
2021-05-13 16:55 ` [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files() wenhuizhang
3 siblings, 0 replies; 11+ messages in thread
From: wenhuizhang @ 2021-05-13 16:53 UTC (permalink / raw)
Cc: wenhuizhang, Steve French, linux-cifs, samba-technical, linux-kernel
Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group).
line 741 struct cifsInodeInfo *cinode;
line 747 cinode = CIFS_I(d_inode(cfile->dentry));
could be deleted.
cinode on filesystem should not be deleted when files are closed, they are representations of some data fields on a physical disk, thus no further action is required.
The virtual inode on vfs will be handled by vfs automatically, and the denotation is inode, which is different from the cinode.
Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
---
fs/cifs/misc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 524dbdfb7184..801a5300f765 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -738,13 +738,11 @@ void
cifs_close_all_deferred_files(struct cifs_tcon *tcon)
{
struct cifsFileInfo *cfile;
- struct cifsInodeInfo *cinode;
struct list_head *tmp;
spin_lock(&tcon->open_file_lock);
list_for_each(tmp, &tcon->openFileList) {
cfile = list_entry(tmp, struct cifsFileInfo, tlist);
- cinode = CIFS_I(d_inode(cfile->dentry));
if (delayed_work_pending(&cfile->deferred))
mod_delayed_work(deferredclose_wq, &cfile->deferred, 0);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files()
2021-05-09 23:33 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
` (2 preceding siblings ...)
2021-05-13 16:53 ` [PATCH] cifs: deadstore delete in deferred files wenhuizhang
@ 2021-05-13 16:55 ` wenhuizhang
2021-05-14 10:59 ` Aurélien Aptel
3 siblings, 1 reply; 11+ messages in thread
From: wenhuizhang @ 2021-05-13 16:55 UTC (permalink / raw)
Cc: wenhuizhang, Steve French, linux-cifs, samba-technical, linux-kernel
Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group).
line 741 struct cifsInodeInfo *cinode;
line 747 cinode = CIFS_I(d_inode(cfile->dentry));
could be deleted.
cinode on filesystem should not be deleted when files are closed,
they are representations of some data fields on a physical disk,
thus no further action is required.
The virtual inode on vfs will be handled by vfs automatically,
and the denotation is inode, which is different from the cinode.
Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
---
fs/cifs/misc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 524dbdfb7184..801a5300f765 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -738,13 +738,11 @@ void
cifs_close_all_deferred_files(struct cifs_tcon *tcon)
{
struct cifsFileInfo *cfile;
- struct cifsInodeInfo *cinode;
struct list_head *tmp;
spin_lock(&tcon->open_file_lock);
list_for_each(tmp, &tcon->openFileList) {
cfile = list_entry(tmp, struct cifsFileInfo, tlist);
- cinode = CIFS_I(d_inode(cfile->dentry));
if (delayed_work_pending(&cfile->deferred))
mod_delayed_work(deferredclose_wq, &cfile->deferred, 0);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files()
2021-05-13 16:55 ` [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files() wenhuizhang
@ 2021-05-14 10:59 ` Aurélien Aptel
2021-05-14 16:01 ` Steve French
0 siblings, 1 reply; 11+ messages in thread
From: Aurélien Aptel @ 2021-05-14 10:59 UTC (permalink / raw)
To: wenhuizhang
Cc: wenhuizhang, Steve French, linux-cifs, samba-technical, linux-kernel
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Cheers,
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files()
2021-05-14 10:59 ` Aurélien Aptel
@ 2021-05-14 16:01 ` Steve French
0 siblings, 0 replies; 11+ messages in thread
From: Steve French @ 2021-05-14 16:01 UTC (permalink / raw)
To: Aurélien Aptel
Cc: wenhuizhang, Steve French, samba-technical, LKML, CIFS
merged into cifs-2.6.git for-next
On Fri, May 14, 2021 at 6:01 AM Aurélien Aptel via samba-technical
<samba-technical@lists.samba.org> wrote:
>
>
> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
>
> Cheers,
> --
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
> SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
>
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
@ 2019-12-27 4:12 wenhuizhang
2019-12-27 15:59 ` Casey Schaufler
0 siblings, 1 reply; 11+ messages in thread
From: wenhuizhang @ 2019-12-27 4:12 UTC (permalink / raw)
To: wenhui
Cc: James Morris, Kees Cook, Matthew Garrett, David Howells,
Casey Schaufler, Joel Fernandes (Google),
Micah Morton, Janne Karhunen, Richard Guy Briggs, linux-kernel
selinux/lsm-common: reorder and format security hooks
Changes to be committed:
modified: include/linux/security.h
Details:
- add default hook for security_cred_getsecid
- group hooks with functionalities and get coherent for orders
---
include/linux/security.h | 46 +++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/include/linux/security.h b/include/linux/security.h
index 3e8d4bacd59d..14f580e37b24 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -462,10 +462,6 @@ static inline int unregister_blocking_lsm_notifier(struct notifier_block *nb)
return 0;
}
-static inline void security_free_mnt_opts(void **mnt_opts)
-{
-}
-
/*
* This is the default capabilities functionality. Most of these functions
* are just stubbed out, but a few must call the proper capable code.
@@ -605,6 +601,9 @@ static inline int security_sb_alloc(struct super_block *sb)
static inline void security_sb_free(struct super_block *sb)
{ }
+static inline void security_free_mnt_opts(void **mnt_opts)
+{ }
+
static inline int security_sb_eat_lsm_opts(char *options,
void **mnt_opts)
{
@@ -679,20 +678,6 @@ static inline int security_move_mount(const struct path *from_path,
return 0;
}
-static inline int security_path_notify(const struct path *path, u64 mask,
- unsigned int obj_type)
-{
- return 0;
-}
-
-static inline int security_inode_alloc(struct inode *inode)
-{
- return 0;
-}
-
-static inline void security_inode_free(struct inode *inode)
-{ }
-
static inline int security_dentry_init_security(struct dentry *dentry,
int mode,
const struct qstr *name,
@@ -710,6 +695,19 @@ static inline int security_dentry_create_files_as(struct dentry *dentry,
return 0;
}
+static inline int security_path_notify(const struct path *path, u64 mask,
+ unsigned int obj_type)
+{
+ return 0;
+}
+
+static inline int security_inode_alloc(struct inode *inode)
+{
+ return 0;
+}
+
+static inline void security_inode_free(struct inode *inode)
+{ }
static inline int security_inode_init_security(struct inode *inode,
struct inode *dir,
@@ -982,8 +980,10 @@ static inline int security_prepare_creds(struct cred *new,
static inline void security_transfer_creds(struct cred *new,
const struct cred *old)
-{
-}
+{ }
+
+static inline void security_cred_getsecid(const struct cred *c, u32 *secid)
+{ }
static inline int security_kernel_act_as(struct cred *cred, u32 secid)
{
@@ -1249,12 +1249,10 @@ static inline int security_secctx_to_secid(const char *secdata,
}
static inline void security_release_secctx(char *secdata, u32 seclen)
-{
-}
+{ }
static inline void security_inode_invalidate_secctx(struct inode *inode)
-{
-}
+{ }
static inline int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
{
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
2019-12-27 4:12 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
@ 2019-12-27 15:59 ` Casey Schaufler
0 siblings, 0 replies; 11+ messages in thread
From: Casey Schaufler @ 2019-12-27 15:59 UTC (permalink / raw)
To: wenhuizhang
Cc: James Morris, Kees Cook, Matthew Garrett, David Howells,
Joel Fernandes (Google),
Micah Morton, Janne Karhunen, Richard Guy Briggs, linux-kernel
On 12/26/2019 8:12 PM, wenhuizhang wrote:
> selinux/lsm-common: reorder and format security hooks
> Changes to be committed:
> modified: include/linux/security.h
> Details:
> - add default hook for security_cred_getsecid
What is this for? Who uses it?
> - group hooks with functionalities and get coherent for orders
Clean-ups should be separate from "real" code changes.
> ---
> include/linux/security.h | 46 +++++++++++++++++++---------------------
> 1 file changed, 22 insertions(+), 24 deletions(-)
>
> diff --git a/include/linux/security.h b/include/linux/security.h
> index 3e8d4bacd59d..14f580e37b24 100644
> --- a/include/linux/security.h
> +++ b/include/linux/security.h
> @@ -462,10 +462,6 @@ static inline int unregister_blocking_lsm_notifier(struct notifier_block *nb)
> return 0;
> }
>
> -static inline void security_free_mnt_opts(void **mnt_opts)
> -{
> -}
> -
> /*
> * This is the default capabilities functionality. Most of these functions
> * are just stubbed out, but a few must call the proper capable code.
> @@ -605,6 +601,9 @@ static inline int security_sb_alloc(struct super_block *sb)
> static inline void security_sb_free(struct super_block *sb)
> { }
>
> +static inline void security_free_mnt_opts(void **mnt_opts)
> +{ }
> +
> static inline int security_sb_eat_lsm_opts(char *options,
> void **mnt_opts)
> {
> @@ -679,20 +678,6 @@ static inline int security_move_mount(const struct path *from_path,
> return 0;
> }
>
> -static inline int security_path_notify(const struct path *path, u64 mask,
> - unsigned int obj_type)
> -{
> - return 0;
> -}
> -
> -static inline int security_inode_alloc(struct inode *inode)
> -{
> - return 0;
> -}
> -
> -static inline void security_inode_free(struct inode *inode)
> -{ }
> -
> static inline int security_dentry_init_security(struct dentry *dentry,
> int mode,
> const struct qstr *name,
> @@ -710,6 +695,19 @@ static inline int security_dentry_create_files_as(struct dentry *dentry,
> return 0;
> }
>
> +static inline int security_path_notify(const struct path *path, u64 mask,
> + unsigned int obj_type)
> +{
> + return 0;
> +}
> +
> +static inline int security_inode_alloc(struct inode *inode)
> +{
> + return 0;
> +}
> +
> +static inline void security_inode_free(struct inode *inode)
> +{ }
>
> static inline int security_inode_init_security(struct inode *inode,
> struct inode *dir,
> @@ -982,8 +980,10 @@ static inline int security_prepare_creds(struct cred *new,
>
> static inline void security_transfer_creds(struct cred *new,
> const struct cred *old)
> -{
> -}
> +{ }
> +
> +static inline void security_cred_getsecid(const struct cred *c, u32 *secid)
> +{ }
>
> static inline int security_kernel_act_as(struct cred *cred, u32 secid)
> {
> @@ -1249,12 +1249,10 @@ static inline int security_secctx_to_secid(const char *secdata,
> }
>
> static inline void security_release_secctx(char *secdata, u32 seclen)
> -{
> -}
> +{ }
>
> static inline void security_inode_invalidate_secctx(struct inode *inode)
> -{
> -}
> +{ }
>
> static inline int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
> {
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-05-14 16:02 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-09 23:33 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
2021-05-11 16:32 ` Aurélien Aptel
[not found] ` <CAOSEQ1p80+JemJkj975ZTt5xw4XCPtOf2uBEvQs9RfW4UkDWXg@mail.gmail.com>
2021-05-11 18:06 ` Aurélien Aptel
2021-05-11 22:34 ` [PATCH] Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group) wenhuizhang
2021-05-12 9:38 ` Aurélien Aptel
2021-05-13 16:53 ` [PATCH] cifs: deadstore delete in deferred files wenhuizhang
2021-05-13 16:55 ` [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files() wenhuizhang
2021-05-14 10:59 ` Aurélien Aptel
2021-05-14 16:01 ` Steve French
-- strict thread matches above, loose matches on Subject: below --
2019-12-27 4:12 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
2019-12-27 15:59 ` Casey Schaufler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.