mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs/ntfs3: remove redundant if-block in check_attr()
@ 2026-07-19 20:25 Matvey Kovalev
  2026-10-07 21:32 ` Konstantin Komarov
  0 siblings, 1 reply; 2+ messages in thread
From: Matvey Kovalev @ 2026-07-19 20:25 UTC (permalink / raw)
  To: matvey.kovalev, Konstantin Komarov; +Cc: ntfs3, linux-kernel, lvc-project

Condition of this if-block repeats another one from if-block above. So,
condition is always false.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru>
---
 fs/ntfs3/fslog.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
index f038c799e7ac..7c40eff69959 100644
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -2753,9 +2753,6 @@ static inline bool check_attr(const struct MFT_REC *rec,
 			return false;
 		}
 
-		if (run_off > asize)
-			return false;
-
 		if (run_unpack(NULL, sbi, 0, svcn, evcn, svcn,
 			       Add2Ptr(attr, run_off), asize - run_off) < 0) {
 			return false;
-- 
2.54.0


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

* Re: [PATCH] fs/ntfs3: remove redundant if-block in check_attr()
  2026-07-19 20:25 [PATCH] fs/ntfs3: remove redundant if-block in check_attr() Matvey Kovalev
@ 2026-10-07 21:32 ` Konstantin Komarov
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Komarov @ 2026-10-07 21:32 UTC (permalink / raw)
  To: Matvey Kovalev; +Cc: ntfs3, linux-kernel, lvc-project

On 7/19/26 22:25, Matvey Kovalev wrote:

> Condition of this if-block repeats another one from if-block above. So,
> condition is always false.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru>
> ---
>   fs/ntfs3/fslog.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
> index f038c799e7ac..7c40eff69959 100644
> --- a/fs/ntfs3/fslog.c
> +++ b/fs/ntfs3/fslog.c
> @@ -2753,9 +2753,6 @@ static inline bool check_attr(const struct MFT_REC *rec,
>                          return false;
>                  }
>
> -               if (run_off > asize)
> -                       return false;
> -
>                  if (run_unpack(NULL, sbi, 0, svcn, evcn, svcn,
>                                 Add2Ptr(attr, run_off), asize - run_off) < 0) {
>                          return false;
> --
> 2.54.0

Hello,

The patch was applied, thanks.

Regards,
Konstantin


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

end of thread, other threads:[~2026-10-07 21:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-19 20:25 [PATCH] fs/ntfs3: remove redundant if-block in check_attr() Matvey Kovalev
2026-10-07 21:32 ` Konstantin Komarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®