Skip to content

Commit d6ca2d2

Browse files
fs/ntfs3: Add and fix comments
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 97ec56d commit d6ca2d2

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

fs/ntfs3/dir.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,10 @@ static int ntfs_dir_count(struct inode *dir, bool *is_empty, size_t *dirs,
536536
e = Add2Ptr(hdr, off);
537537
e_size = le16_to_cpu(e->size);
538538
if (e_size < sizeof(struct NTFS_DE) ||
539-
off + e_size > end)
539+
off + e_size > end) {
540+
/* Looks like corruption. */
540541
break;
542+
}
541543

542544
if (de_is_last(e))
543545
break;

fs/ntfs3/fsntfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,8 +2129,8 @@ int ntfs_insert_security(struct ntfs_sb_info *sbi,
21292129
if (le32_to_cpu(d_security->size) == new_sec_size &&
21302130
d_security->key.hash == hash_key.hash &&
21312131
!memcmp(d_security + 1, sd, size_sd)) {
2132-
*security_id = d_security->key.sec_id;
21332132
/* Such security already exists. */
2133+
*security_id = d_security->key.sec_id;
21342134
err = 0;
21352135
goto out;
21362136
}

fs/ntfs3/ntfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ struct ATTR_LIST_ENTRY {
523523
__le64 vcn; // 0x08: Starting VCN of this attribute.
524524
struct MFT_REF ref; // 0x10: MFT record number with attribute.
525525
__le16 id; // 0x18: struct ATTRIB ID.
526-
__le16 name[]; // 0x1A: Just to align. To get real name can use name_off.
526+
__le16 name[]; // 0x1A: To get real name use name_off.
527527

528528
}; // sizeof(0x20)
529529

fs/ntfs3/ntfs_fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
874874

875875
int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry);
876876
ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
877-
extern const struct xattr_handler * const ntfs_xattr_handlers[];
877+
extern const struct xattr_handler *const ntfs_xattr_handlers[];
878878

879879
int ntfs_save_wsl_perm(struct inode *inode, __le16 *ea_size);
880880
void ntfs_get_wsl_perm(struct inode *inode);

0 commit comments

Comments
 (0)