From: Hyunchul Lee Date: Fri, 13 Mar 2026 00:25:21 +0000 (+0900) Subject: ntfs: fix inconsistent indenting warnings X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=068a35fd7293c20ba35cc3f19ce981c038cc9328;p=thirdparty%2Fkernel%2Flinux.git ntfs: fix inconsistent indenting warnings Detected by Smatch. ndex.c:2041 ntfs_index_walk_up() warn: inconsistent indenting mft.c:2462 ntfs_mft_record_alloc() warn: inconsistent indenting Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon --- diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c index 42251bdb6f5ae..2080f39691378 100644 --- a/fs/ntfs/index.c +++ b/fs/ntfs/index.c @@ -2007,43 +2007,43 @@ struct index_entry *ntfs_index_walk_down(struct index_entry *ie, struct ntfs_ind static struct index_entry *ntfs_index_walk_up(struct index_entry *ie, struct ntfs_index_context *ictx) { - struct index_entry *entry; + struct index_entry *entry = ie; s64 vcn; - entry = ie; - if (ictx->pindex > 0) { - do { - ictx->pindex--; - if (!ictx->pindex) { - /* we have reached the root */ - kfree(ictx->ib); - ictx->ib = NULL; - ictx->is_in_root = true; - /* a new search context is to be allocated */ - if (ictx->actx) - ntfs_attr_put_search_ctx(ictx->actx); - ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name, - ictx->name_len, &ictx->actx); - if (ictx->ir) - entry = ntfs_ie_get_by_pos(&ictx->ir->index, - ictx->parent_pos[ictx->pindex]); - else - entry = NULL; - } else { - /* up into non-root node */ - vcn = ictx->parent_vcn[ictx->pindex]; - if (!ntfs_ib_read(ictx, vcn, ictx->ib)) { - entry = ntfs_ie_get_by_pos(&ictx->ib->index, - ictx->parent_pos[ictx->pindex]); - } else - entry = NULL; - } - ictx->entry = entry; - } while (entry && (ictx->pindex > 0) && - (entry->flags & INDEX_ENTRY_END)); - } else - entry = NULL; + if (ictx->pindex <= 0) + return NULL; + do { + ictx->pindex--; + if (!ictx->pindex) { + /* we have reached the root */ + kfree(ictx->ib); + ictx->ib = NULL; + ictx->is_in_root = true; + /* a new search context is to be allocated */ + if (ictx->actx) + ntfs_attr_put_search_ctx(ictx->actx); + ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name, + ictx->name_len, &ictx->actx); + if (ictx->ir) + entry = ntfs_ie_get_by_pos( + &ictx->ir->index, + ictx->parent_pos[ictx->pindex]); + else + entry = NULL; + } else { + /* up into non-root node */ + vcn = ictx->parent_vcn[ictx->pindex]; + if (!ntfs_ib_read(ictx, vcn, ictx->ib)) { + entry = ntfs_ie_get_by_pos( + &ictx->ib->index, + ictx->parent_pos[ictx->pindex]); + } else + entry = NULL; + } + ictx->entry = entry; + } while (entry && (ictx->pindex > 0) && + (entry->flags & INDEX_ENTRY_END)); return entry; } diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 48e64eaa7ec33..8de0a1e47c2e6 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -2459,7 +2459,7 @@ mft_rec_already_initialized: m->flags &= cpu_to_le16( ~le16_to_cpu(MFT_RECORD_IN_USE)); /* Make sure the mft record is written out to disk. */ - ntfs_mft_mark_dirty(folio); + ntfs_mft_mark_dirty(folio); folio_unlock(folio); kunmap_local(m); folio_put(folio);