linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: remove the useless value assignment in btrfs_defrag_file
@ 2020-11-14  9:06 xiakaixu1987
  2020-11-16 15:13 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: xiakaixu1987 @ 2020-11-14  9:06 UTC (permalink / raw)
  To: clm, josef, dsterba; +Cc: linux-btrfs, linux-kernel, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

The variable ret is overwritten by the following variable defrag_count
and this assignment is useless, so remove it.

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 fs/btrfs/ioctl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 69a384145dc6..5771678281d6 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1518,7 +1518,6 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
 
 		if (btrfs_defrag_cancelled(fs_info)) {
 			btrfs_debug(fs_info, "defrag_file cancelled");
-			ret = -EAGAIN;
 			break;
 		}
 
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: remove the useless value assignment in btrfs_defrag_file
  2020-11-14  9:06 [PATCH] btrfs: remove the useless value assignment in btrfs_defrag_file xiakaixu1987
@ 2020-11-16 15:13 ` David Sterba
  2020-11-17  2:53   ` kaixuxia
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2020-11-16 15:13 UTC (permalink / raw)
  To: xiakaixu1987; +Cc: clm, josef, dsterba, linux-btrfs, linux-kernel, Kaixu Xia

On Sat, Nov 14, 2020 at 05:06:21PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> The variable ret is overwritten by the following variable defrag_count
> and this assignment is useless, so remove it.

This could be actually pointing to a bug, please explain why you think
it's correct to remove it and not to return EAGAIN.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: remove the useless value assignment in btrfs_defrag_file
  2020-11-16 15:13 ` David Sterba
@ 2020-11-17  2:53   ` kaixuxia
  0 siblings, 0 replies; 3+ messages in thread
From: kaixuxia @ 2020-11-17  2:53 UTC (permalink / raw)
  To: dsterba, clm, josef, dsterba, linux-btrfs, linux-kernel, Kaixu Xia



On 2020/11/16 23:13, David Sterba wrote:
> On Sat, Nov 14, 2020 at 05:06:21PM +0800, xiakaixu1987@gmail.com wrote:
>> From: Kaixu Xia <kaixuxia@tencent.com>
>>
>> The variable ret is overwritten by the following variable defrag_count
>> and this assignment is useless, so remove it.
> 
> This could be actually pointing to a bug, please explain why you think
> it's correct to remove it and not to return EAGAIN.

The right fix should be goto out_ra and return EAGAIN. I will do it
in the next version.

Thanks,
Kaixu
> 

-- 
kaixuxia

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-17  2:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-14  9:06 [PATCH] btrfs: remove the useless value assignment in btrfs_defrag_file xiakaixu1987
2020-11-16 15:13 ` David Sterba
2020-11-17  2:53   ` kaixuxia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).