linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ext4: remove redundant assignment in ext4_iomap_begin()
@ 2017-11-27  9:21 sunqiuyang
  2017-12-21 16:47 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: sunqiuyang @ 2017-11-27  9:21 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-ext4; +Cc: sunqiuyang

From: Qiuyang Sun <sunqiuyang@huawei.com>

This line will not change the value of map.m_lblk in any case.

Signed-off-by: Qiuyang Sun <sunqiuyang@huawei.com>
---
 fs/ext4/inode.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 9f836e2..d4a42b1 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3443,7 +3443,6 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
 
 				if (es.es_lblk < map.m_lblk)
 					offs = map.m_lblk - es.es_lblk;
-				map.m_lblk = es.es_lblk + offs;
 				map.m_len = es.es_len - offs;
 				delalloc = true;
 			}
-- 
2.5.0

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

* Re: [PATCH 1/1] ext4: remove redundant assignment in ext4_iomap_begin()
  2017-11-27  9:21 [PATCH 1/1] ext4: remove redundant assignment in ext4_iomap_begin() sunqiuyang
@ 2017-12-21 16:47 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2017-12-21 16:47 UTC (permalink / raw)
  To: sunqiuyang; +Cc: linux-kernel, linux-fsdevel, linux-ext4

On Mon, Nov 27, 2017 at 05:21:27PM +0800, sunqiuyang wrote:
> From: Qiuyang Sun <sunqiuyang@huawei.com>
> 
> This line will not change the value of map.m_lblk in any case.

I don't see that it is absolutely guaranteed.  And if you are
depending on ext4_es_find_delayed_extent() returns, then (a) the
following line which adjusts map.m_len could also be dropped, and (b)
we should add a WARN_ON to make the code robust against future changes
to the above function.

						- Ted

> 
> Signed-off-by: Qiuyang Sun <sunqiuyang@huawei.com>
> ---
>  fs/ext4/inode.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 9f836e2..d4a42b1 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -3443,7 +3443,6 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
>  
>  				if (es.es_lblk < map.m_lblk)
>  					offs = map.m_lblk - es.es_lblk;
> -				map.m_lblk = es.es_lblk + offs;
>  				map.m_len = es.es_len - offs;
>  				delalloc = true;
>  			}
> -- 
> 2.5.0
> 

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

end of thread, other threads:[~2017-12-21 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27  9:21 [PATCH 1/1] ext4: remove redundant assignment in ext4_iomap_begin() sunqiuyang
2017-12-21 16:47 ` Theodore Ts'o

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).