* [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
@ 2021-09-09 10:57 Konstantin Komarov
2021-09-09 12:36 ` Kari Argillander
0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Komarov @ 2021-09-09 10:57 UTC (permalink / raw)
To: ntfs3; +Cc: linux-kernel, linux-fsdevel
Do not try to insert attribute if there is no room in record.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/frecord.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 938b12d56ca6..5dd7b7a7c5e0 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -956,6 +956,10 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
continue;
}
+ /* Do not try to insert this attribute if there is no room in record. */
+ if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size)
+ continue;
+
/* Try to insert attribute into this subrecord. */
attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize,
name_off, svcn, ins_le);
--
2.28.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
2021-09-09 10:57 [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Konstantin Komarov
@ 2021-09-09 12:36 ` Kari Argillander
0 siblings, 0 replies; 4+ messages in thread
From: Kari Argillander @ 2021-09-09 12:36 UTC (permalink / raw)
To: Konstantin Komarov; +Cc: ntfs3, linux-kernel, linux-fsdevel
On Thu, Sep 09, 2021 at 01:57:59PM +0300, Konstantin Komarov wrote:
> Do not try to insert attribute if there is no room in record.
>
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
> ---
> fs/ntfs3/frecord.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> index 938b12d56ca6..5dd7b7a7c5e0 100644
> --- a/fs/ntfs3/frecord.c
> +++ b/fs/ntfs3/frecord.c
> @@ -956,6 +956,10 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
> continue;
> }
>
> + /* Do not try to insert this attribute if there is no room in record. */
Multiline comment as this gets very long.
> + if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size)
> + continue;
> +
> /* Try to insert attribute into this subrecord. */
> attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize,
> name_off, svcn, ins_le);
> --
> 2.28.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 0/3] fs/ntfs3: Speed up hardlink creation
@ 2021-09-13 15:09 Konstantin Komarov
2021-09-13 15:12 ` [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Konstantin Komarov
0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Komarov @ 2021-09-13 15:09 UTC (permalink / raw)
To: ntfs3; +Cc: linux-kernel, linux-fsdevel
xfstest generic/041 was taking some time before failing,
so this series aims to fix it and speed up.
Because of this we raise hardlinks limit to 4000.
There are no drawbacks or regressions.
Theoretically we can raise all the way up to ffff,
but there is no practical use for this.
Konstantin Komarov (3):
fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
fs/ntfs3: Change max hardlinks limit to 4000
fs/ntfs3: Add sync flag to ntfs_sb_write_run and al_update
fs/ntfs3/attrib.c | 2 +-
fs/ntfs3/attrlist.c | 6 +++---
fs/ntfs3/frecord.c | 9 ++++++++-
fs/ntfs3/fslog.c | 8 ++++----
fs/ntfs3/fsntfs.c | 8 ++++----
fs/ntfs3/inode.c | 2 +-
fs/ntfs3/ntfs.h | 8 +++++---
fs/ntfs3/ntfs_fs.h | 4 ++--
fs/ntfs3/xattr.c | 2 +-
9 files changed, 29 insertions(+), 20 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
2021-09-13 15:09 [PATCH 0/3] fs/ntfs3: Speed up hardlink creation Konstantin Komarov
@ 2021-09-13 15:12 ` Konstantin Komarov
2021-09-18 7:02 ` Kari Argillander
0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Komarov @ 2021-09-13 15:12 UTC (permalink / raw)
To: ntfs3; +Cc: linux-kernel, linux-fsdevel
Do not try to insert attribute if there is no room in record.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/frecord.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 938b12d56ca6..834cb361f61f 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -956,6 +956,13 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
continue;
}
+ /*
+ * Do not try to insert this attribute
+ * if there is no room in record.
+ */
+ if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size)
+ continue;
+
/* Try to insert attribute into this subrecord. */
attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize,
name_off, svcn, ins_le);
--
2.33.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
2021-09-13 15:12 ` [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Konstantin Komarov
@ 2021-09-18 7:02 ` Kari Argillander
0 siblings, 0 replies; 4+ messages in thread
From: Kari Argillander @ 2021-09-18 7:02 UTC (permalink / raw)
To: Konstantin Komarov; +Cc: ntfs3, linux-kernel, linux-fsdevel
On Mon, Sep 13, 2021 at 06:12:58PM +0300, Konstantin Komarov wrote:
> Do not try to insert attribute if there is no room in record.
>
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Reviewed-by: Kari Argillander <kari.argillander@gmail.com>
> ---
> fs/ntfs3/frecord.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> index 938b12d56ca6..834cb361f61f 100644
> --- a/fs/ntfs3/frecord.c
> +++ b/fs/ntfs3/frecord.c
> @@ -956,6 +956,13 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
> continue;
> }
>
> + /*
> + * Do not try to insert this attribute
> + * if there is no room in record.
> + */
> + if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size)
> + continue;
> +
> /* Try to insert attribute into this subrecord. */
> attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize,
> name_off, svcn, ins_le);
> --
> 2.33.0
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-18 7:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 10:57 [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Konstantin Komarov
2021-09-09 12:36 ` Kari Argillander
2021-09-13 15:09 [PATCH 0/3] fs/ntfs3: Speed up hardlink creation Konstantin Komarov
2021-09-13 15:12 ` [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Konstantin Komarov
2021-09-18 7:02 ` Kari Argillander
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.