2023-02-15 13:41:16

by Konstantin Komarov

[permalink] [raw]
Subject: [PATCH 00/11] fs/ntfs3: Bugfix and refactoring

This series contains various fixes and refactoring for ntfs3.
Added error output on failed mount. Reworked some other error messages.

Konstantin Komarov (11):
  fs/ntfs3: Use bh_read to simplify code
  fs/ntfs3: Remove noacsrules
  fs/ntfs3: Fix ntfs_create_inode()
  fs/ntfs3: Optimization in ntfs_set_state()
  fs/ntfs3: Undo endian changes
  fs/ntfs3: Undo critial modificatins to keep directory consistency
  fs/ntfs3: Remove field sbi->used.bitmap.set_tail
  fs/ntfs3: Changed ntfs_get_acl() to use dentry
  fs/ntfs3: Code formatting and refactoring
  fs/ntfs3: Add missed "nocase" in ntfs_show_options
  fs/ntfs3: Print details about mount fails

 Documentation/filesystems/ntfs3.rst |  11 --
 fs/ntfs3/attrib.c                   |  17 +-
 fs/ntfs3/bitmap.c                   |  22 +--
 fs/ntfs3/file.c                     |  50 ++---
 fs/ntfs3/frecord.c                  |  39 ++--
 fs/ntfs3/fslog.c                    |  77 ++++----
 fs/ntfs3/fsntfs.c                   |  73 +++----
 fs/ntfs3/index.c                    |  58 +++---
 fs/ntfs3/inode.c                    | 118 +++++------
 fs/ntfs3/lznt.c                     |  10 +-
 fs/ntfs3/namei.c                    |   9 +-
 fs/ntfs3/ntfs_fs.h                  |  16 +-
 fs/ntfs3/record.c                   |   9 +-
 fs/ntfs3/run.c                      |   6 +-
 fs/ntfs3/super.c                    | 291 ++++++++++++++++------------
 fs/ntfs3/xattr.c                    |  64 +++---
 16 files changed, 435 insertions(+), 435 deletions(-)


2023-02-15 13:41:19

by Konstantin Komarov

[permalink] [raw]
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 <[email protected]>
---
 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