Skip to content

Commit 5c1c88c

Browse files
committed
Merge tag 'v6.5/fs.ntfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull ntfs updates from Christian Brauner: "A pile of various smaller fixes for ntfs" * tag 'v6.5/fs.ntfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: ntfs: do not dereference a null ctx on error ntfs: Remove unneeded semicolon ntfs: Correct spelling ntfs: remove redundant initialization to pointer cb_sb_start
2 parents 1f268d6 + aa4b92c commit 5c1c88c

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

fs/ntfs/attrib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2491,7 +2491,7 @@ s64 ntfs_attr_extend_allocation(ntfs_inode *ni, s64 new_alloc_size,
24912491
* byte offset @ofs inside the attribute with the constant byte @val.
24922492
*
24932493
* This function is effectively like memset() applied to an ntfs attribute.
2494-
* Note thie function actually only operates on the page cache pages belonging
2494+
* Note this function actually only operates on the page cache pages belonging
24952495
* to the ntfs attribute and it marks them dirty after doing the memset().
24962496
* Thus it relies on the vm dirty page write code paths to cause the modified
24972497
* pages to be written to the mft record/disk.

fs/ntfs/compress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static int ntfs_decompress(struct page *dest_pages[], int completed_pages[],
161161
*/
162162
u8 *cb_end = cb_start + cb_size; /* End of cb. */
163163
u8 *cb = cb_start; /* Current position in cb. */
164-
u8 *cb_sb_start = cb; /* Beginning of the current sb in the cb. */
164+
u8 *cb_sb_start; /* Beginning of the current sb in the cb. */
165165
u8 *cb_sb_end; /* End of current sb / beginning of next sb. */
166166

167167
/* Variables for uncompressed data / destination. */

fs/ntfs/mft.c

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,36 +1955,38 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)
19551955
"attribute.%s", es);
19561956
NVolSetErrors(vol);
19571957
}
1958-
a = ctx->attr;
1958+
19591959
if (ntfs_rl_truncate_nolock(vol, &mft_ni->runlist, old_last_vcn)) {
19601960
ntfs_error(vol->sb, "Failed to truncate mft data attribute "
19611961
"runlist.%s", es);
19621962
NVolSetErrors(vol);
19631963
}
1964-
if (mp_rebuilt && !IS_ERR(ctx->mrec)) {
1965-
if (ntfs_mapping_pairs_build(vol, (u8*)a + le16_to_cpu(
1964+
if (ctx) {
1965+
a = ctx->attr;
1966+
if (mp_rebuilt && !IS_ERR(ctx->mrec)) {
1967+
if (ntfs_mapping_pairs_build(vol, (u8 *)a + le16_to_cpu(
19661968
a->data.non_resident.mapping_pairs_offset),
19671969
old_alen - le16_to_cpu(
1968-
a->data.non_resident.mapping_pairs_offset),
1970+
a->data.non_resident.mapping_pairs_offset),
19691971
rl2, ll, -1, NULL)) {
1970-
ntfs_error(vol->sb, "Failed to restore mapping pairs "
1972+
ntfs_error(vol->sb, "Failed to restore mapping pairs "
19711973
"array.%s", es);
1972-
NVolSetErrors(vol);
1973-
}
1974-
if (ntfs_attr_record_resize(ctx->mrec, a, old_alen)) {
1975-
ntfs_error(vol->sb, "Failed to restore attribute "
1974+
NVolSetErrors(vol);
1975+
}
1976+
if (ntfs_attr_record_resize(ctx->mrec, a, old_alen)) {
1977+
ntfs_error(vol->sb, "Failed to restore attribute "
19761978
"record.%s", es);
1979+
NVolSetErrors(vol);
1980+
}
1981+
flush_dcache_mft_record_page(ctx->ntfs_ino);
1982+
mark_mft_record_dirty(ctx->ntfs_ino);
1983+
} else if (IS_ERR(ctx->mrec)) {
1984+
ntfs_error(vol->sb, "Failed to restore attribute search "
1985+
"context.%s", es);
19771986
NVolSetErrors(vol);
19781987
}
1979-
flush_dcache_mft_record_page(ctx->ntfs_ino);
1980-
mark_mft_record_dirty(ctx->ntfs_ino);
1981-
} else if (IS_ERR(ctx->mrec)) {
1982-
ntfs_error(vol->sb, "Failed to restore attribute search "
1983-
"context.%s", es);
1984-
NVolSetErrors(vol);
1985-
}
1986-
if (ctx)
19871988
ntfs_attr_put_search_ctx(ctx);
1989+
}
19881990
if (!IS_ERR(mrec))
19891991
unmap_mft_record(mft_ni);
19901992
up_write(&mft_ni->runlist.lock);

fs/ntfs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,7 @@ static bool load_and_init_attrdef(ntfs_volume *vol)
16201620
memcpy((u8*)vol->attrdef + (index++ << PAGE_SHIFT),
16211621
page_address(page), size);
16221622
ntfs_unmap_page(page);
1623-
};
1623+
}
16241624
if (size == PAGE_SIZE) {
16251625
size = i_size & ~PAGE_MASK;
16261626
if (size)
@@ -1689,7 +1689,7 @@ static bool load_and_init_upcase(ntfs_volume *vol)
16891689
memcpy((char*)vol->upcase + (index++ << PAGE_SHIFT),
16901690
page_address(page), size);
16911691
ntfs_unmap_page(page);
1692-
};
1692+
}
16931693
if (size == PAGE_SIZE) {
16941694
size = i_size & ~PAGE_MASK;
16951695
if (size)

0 commit comments

Comments
 (0)