debugfs: remove unused variable
PATCH 1/1 debugfs: remove unused variable
--- fs/debugfs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/debugfs/file.c +1 -2
@@ -195,7 +195,6 @@ static int full_proxy_release(struct inode *inode, struct file *filp)const struct dentry *dentry =F_DENTRY (filp);const struct file_operations *real_fops =REAL_FOPS_DEREF (dentry);const struct file_operations *proxy_fops = filp->f_op; -int r =0 ;/* * We must not protect this against removal races here: the
@@ -204,7 +203,7 @@ static int full_proxy_release(struct inode *inode, struct file *filp)* ->i_private is still being meaningful here. */ if (real_fops->release) - r = real_fops->release (inode, filp); + real_fops->release (inode, filp);replace_fops (filp,d_inode (dentry)->i_fop);kfree ((void *)proxy_fops);
Signature · 2 lines
Cheers, Eric
Greg Kroah-Hartman
maintainerQuoted 18 lines · Eric Engestrom
Signed-off-by Eric Engestrom <[email protected]>--- fs/debugfs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/debugfs/file.c +0
-1@@ -195,7 +195,6 @@ static int full_proxy_release(struct inode *inode, struct file *filp)const struct dentry *dentry =F_DENTRY (filp);const struct file_operations *real_fops =REAL_FOPS_DEREF (dentry);const struct file_operations *proxy_fops = filp->f_op; -int r =0 ;/* * We must not protect this against removal races here: the
fs/debugfs/file.c static int full_proxy_release(struct inode *inode, struct file *filp) · line 206
Quoted 5 lines
fs/debugfs/file.c +1
-1@@ -204,7 +203,7 @@ static int full_proxy_release(struct inode *inode, struct file *filp)* ->i_private is still being meaningful here. */ if (real_fops->release) - r = real_fops->release (inode, filp); + real_fops->release (inode, filp);
Hm, shouldn't we be propagating the result back up the call chain?
thanks,
greg k-h
Quoted 16 lines · Greg Kroah-Hartman
Quoted 15 lines · Eric Engestrom
Signed-off-by Eric Engestrom <[email protected]>--- fs/debugfs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/debugfs/file.c +0
-1@@ -195,7 +195,6 @@ static int full_proxy_release(struct inode *inode, struct file *filp)const struct dentry *dentry =F_DENTRY (filp);const struct file_operations *real_fops =REAL_FOPS_DEREF (dentry);const struct file_operations *proxy_fops = filp->f_op; -int r =0 ;
Quoted 10 lines
fs/debugfs/file.c static int full_proxy_release(struct inode *inode, struct file *filp) · line 206
Quoted 8 lines
fs/debugfs/file.c +1
-1/* * We must not protect this against removal races here: the @@ -204,7 +203,7 @@ static int full_proxy_release(struct inode *inode, struct file *filp)* ->i_private is still being meaningful here. */ if (real_fops->release) - r = real_fops->release (inode, filp); + real_fops->release (inode, filp);Hm, shouldn't we be propagating the result back up the call chain?
You're right, sorry, I wasn't thinking. Correct fix incoming :)
Cheers,
Eric
Quoted 4 lines
thanks,
greg k-h
PATCH 1/1 debugfs: propagate release() call result
In reply to Greg Kroah-Hartman--- fs/debugfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/debugfs/file.c +1 -1
@@ -209,7 +209,7 @@ static int full_proxy_release(struct inode *inode, struct file *filp)replace_fops (filp,d_inode (dentry)->i_fop);kfree ((void *)proxy_fops);fops_put (real_fops); -return 0 ; +return r; } static void __full_proxy_fops_init(struct file_operations *proxy_fops,
Signature · 2 lines
Cheers, Eric
Greg Kroah-Hartman
maintainerRe: [PATCH] debugfs: propagate release() call result
Quoted 1 line · Eric Engestrom
Signed-off-by Eric Engestrom <[email protected]>
Oops, I can't take patches without any changelog text at all.
Please fix up and resend.
thanks,
greg k-h
PATCH v2 1/1 debugfs: propagate release() call result
The result was being ignored and 0 was always returned. Return the actual result instead.
---
v2: add a commit message
--- fs/debugfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/debugfs/file.c +1 -1
@@ -209,7 +209,7 @@ static int full_proxy_release(struct inode *inode, struct file *filp)replace_fops (filp,d_inode (dentry)->i_fop);kfree ((void *)proxy_fops);fops_put (real_fops); -return 0 ; +return r; } static void __full_proxy_fops_init(struct file_operations *proxy_fops,
Signature · 2 lines
Cheers, Eric
Nicolai Stange
Reviewed-byQuoted 16 lines · Greg Kroah-Hartman
Quoted 15 lines · Eric Engestrom
Signed-off-by Eric Engestrom <[email protected]>--- fs/debugfs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/debugfs/file.c +0
-1@@ -195,7 +195,6 @@ static int full_proxy_release(struct inode *inode, struct file *filp)const struct dentry *dentry =F_DENTRY (filp);const struct file_operations *real_fops =REAL_FOPS_DEREF (dentry);const struct file_operations *proxy_fops = filp->f_op; -int r =0 ;
Quoted 10 lines
fs/debugfs/file.c static int full_proxy_release(struct inode *inode, struct file *filp) · line 206
Quoted 8 lines
fs/debugfs/file.c +1
-1/* * We must not protect this against removal races here: the @@ -204,7 +203,7 @@ static int full_proxy_release(struct inode *inode, struct file *filp)* ->i_private is still being meaningful here. */ if (real_fops->release) - r = real_fops->release (inode, filp); + real_fops->release (inode, filp);Hm, shouldn't we be propagating the result back up the call chain?
AFAICS, the VFS layer doesn't ever evaluate the return value of ->release(), c.f. __fput() in fs/file_table.c .
OTOH, propagating that value back to caller also wouldn't hurt. But this would be a matter of taste/coding style.
I can't remember whether I left this unused int r there on purpose. I doubt not. Eric, did you run your patch through sparse and Coccinelle?
If so,
for the diff. (This patch lacks a description though.)
Thanks,
Nicolai
Quoted 29 lines · Nicolai Stange
Quoted 16 lines · Greg Kroah-Hartman
Quoted 15 lines · Eric Engestrom
Signed-off-by Eric Engestrom <[email protected]>--- fs/debugfs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/debugfs/file.c +0
-1@@ -195,7 +195,6 @@ static int full_proxy_release(struct inode *inode, struct file *filp)const struct dentry *dentry =F_DENTRY (filp);const struct file_operations *real_fops =REAL_FOPS_DEREF (dentry);const struct file_operations *proxy_fops = filp->f_op; -int r =0 ;Quoted 10 lines
fs/debugfs/file.c static int full_proxy_release(struct inode *inode, struct file *filp) · line 206
Quoted 8 lines
fs/debugfs/file.c +1
-1/* * We must not protect this against removal races here: the @@ -204,7 +203,7 @@ static int full_proxy_release(struct inode *inode, struct file *filp)* ->i_private is still being meaningful here. */ if (real_fops->release) - r = real_fops->release (inode, filp); + real_fops->release (inode, filp);Hm, shouldn't we be propagating the result back up the call chain?
Quoted 5 lines
AFAICS, the VFS layer doesn't ever evaluate the return value of ->release(), c.f.
__fput()infs/file_table.c.OTOH, propagating that value back to caller also wouldn't hurt. But this would be a matter of taste/coding style.
I actually sent an updated fix [1] about an hour ago, which propagates the result instead (which is better IMO, I don't know why I didn't do that the first time around).
[1] http://marc.info/?m=147444718118891 (lkml.org is down?)
Quoted 3 lines
I can't remember whether I left this unused int r there on purpose. I doubt not. Eric, did you run your patch through sparse and Coccinelle?
I didn't; how do I do that? I know these tools, but not how to use them in this context.
Cheers,
Eric
Quoted 11 lines
If so,
Reviewed-by Nicolai Stange <[email protected]>for the diff. (This patch lacks a description though.)
Thanks,
Nicolai