lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878105e3-d075-4d4e-5c47-3f22f95e23c8@paragon-software.com>
Date:   Wed, 15 Feb 2023 17:34:13 +0400
From:   Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To:     <ntfs3@...ts.linux.dev>
CC:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        <linux-fsdevel@...r.kernel.org>
Subject: [PATCH 01/11] fs/ntfs3: Use bh_read to simplify code

The duplicating code is replaced by a generic function bh_read()

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
---
  fs/ntfs3/file.c  | 10 ++--------
  fs/ntfs3/inode.c |  1 +
  2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index d294cd975688..d37df7376543 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -223,16 +223,10 @@ static int ntfs_zero_range(struct inode *inode, 
u64 vbo, u64 vbo_to)
                  set_buffer_uptodate(bh);

              if (!buffer_uptodate(bh)) {
-                lock_buffer(bh);
-                bh->b_end_io = end_buffer_read_sync;
-                get_bh(bh);
-                submit_bh(REQ_OP_READ, bh);
-
-                wait_on_buffer(bh);
-                if (!buffer_uptodate(bh)) {
+                err = bh_read(bh, 0);
+                if (err < 0) {
                      unlock_page(page);
                      put_page(page);
-                    err = -EIO;
                      goto out;
                  }
              }
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index e80e94325467..5e06299591ed 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -648,6 +648,7 @@ static noinline int ntfs_get_block_vbo(struct inode 
*inode, u64 vbo,
              bh->b_size = block_size;
              off = vbo & (PAGE_SIZE - 1);
              set_bh_page(bh, page, off);
+
              err = bh_read(bh, 0);
              if (err < 0)
                  goto out;
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ