]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ntfs: add missing newlines to pr_err() messages
authorWoody Suwalski <terraluna977@gmail.com>
Tue, 10 Mar 2026 08:50:57 +0000 (17:50 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Tue, 10 Mar 2026 08:52:13 +0000 (17:52 +0900)
There is an inconsistent use of pr_err() statements in the current code.
Many error messages are missing the \n termination, what results in the
messages being printed with a delay, only after a next printk() line is
printed. It prevents relying on printk() to monitor the driver errors.
This patch is modifying only text messages, no functional change.

Signed-off-by: Woody Suwalski <terraluna977@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/attrib.c
fs/ntfs/ea.c
fs/ntfs/runlist.c

index 48759f6a78c4166eb044f952b8144f9d36ad005f..7c523eb87894019ef53498f2846878ff2f13c567 100644 (file)
@@ -2062,7 +2062,7 @@ static int ntfs_make_room_for_attr(struct mft_record *m, u8 *pos, u32 size)
 
        /* Rigorous consistency checks. */
        if (!m || !pos || pos < (u8 *)m) {
-               pr_err("%s: pos=%p  m=%p", __func__, pos, m);
+               pr_err("%s: pos=%p  m=%p\n", __func__, pos, m);
                return -EINVAL;
        }
 
@@ -2240,16 +2240,16 @@ static int ntfs_non_resident_attr_record_add(struct ntfs_inode *ni, __le32 type,
        err = ntfs_attr_can_be_non_resident(ni->vol, type);
        if (err) {
                if (err == -EPERM)
-                       pr_err("Attribute can't be non resident");
+                       pr_err("Attribute can't be non resident\n");
                else
-                       pr_err("ntfs_attr_can_be_non_resident failed");
+                       pr_err("ntfs_attr_can_be_non_resident failed\n");
                return err;
        }
 
        /* Locate place where record should be. */
        ctx = ntfs_attr_get_search_ctx(ni, NULL);
        if (!ctx) {
-               pr_err("%s: Failed to get search context", __func__);
+               pr_err("%s: Failed to get search context\n", __func__);
                return -ENOMEM;
        }
        /*
@@ -2260,11 +2260,11 @@ static int ntfs_non_resident_attr_record_add(struct ntfs_inode *ni, __le32 type,
        err = ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, NULL, 0, ctx);
        if (!err) {
                err = -EEXIST;
-               pr_err("Attribute 0x%x already present", type);
+               pr_err("Attribute 0x%x already present\n", type);
                goto put_err_out;
        }
        if (err != -ENOENT) {
-               pr_err("ntfs_attr_find failed");
+               pr_err("ntfs_attr_find failed\n");
                err = -EIO;
                goto put_err_out;
        }
@@ -2279,7 +2279,7 @@ static int ntfs_non_resident_attr_record_add(struct ntfs_inode *ni, __le32 type,
                 sizeof(a->data.non_resident.compressed_size) : 0);
        err = ntfs_make_room_for_attr(ctx->mrec, (u8 *) ctx->attr, length);
        if (err) {
-               pr_err("Failed to make room for attribute");
+               pr_err("Failed to make room for attribute\n");
                goto put_err_out;
        }
 
@@ -2319,7 +2319,7 @@ static int ntfs_non_resident_attr_record_add(struct ntfs_inode *ni, __le32 type,
        if (type != AT_ATTRIBUTE_LIST && NInoAttrList(base_ni)) {
                err = ntfs_attrlist_entry_add(ni, a);
                if (err) {
-                       pr_err("Failed add attr entry to attrlist");
+                       pr_err("Failed add attr entry to attrlist\n");
                        ntfs_attr_record_resize(m, a, 0);
                        goto put_err_out;
                }
@@ -2334,7 +2334,7 @@ static int ntfs_non_resident_attr_record_add(struct ntfs_inode *ni, __le32 type,
        err = ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE,
                                lowest_vcn, NULL, 0, ctx);
        if (err) {
-               pr_err("%s: attribute lookup failed", __func__);
+               pr_err("%s: attribute lookup failed\n", __func__);
                ntfs_attr_put_search_ctx(ctx);
                return err;
 
@@ -2825,7 +2825,7 @@ int ntfs_attr_open(struct ntfs_inode *ni, const __le32 type,
        ctx = ntfs_attr_get_search_ctx(base_ni, NULL);
        if (!ctx) {
                err = -ENOMEM;
-               pr_err("%s: Failed to get search context", __func__);
+               pr_err("%s: Failed to get search context\n", __func__);
                goto err_out;
        }
 
@@ -4615,7 +4615,7 @@ int ntfs_attr_expand(struct ntfs_inode *ni, const s64 newsize, const s64 preallo
         * which is what Windows NT4 does, too.
         */
        if (NInoEncrypted(ni)) {
-               pr_err("Failed to truncate encrypted attribute");
+               pr_err("Failed to truncate encrypted attribute\n");
                return -EACCES;
        }
 
@@ -4669,12 +4669,12 @@ int ntfs_attr_truncate_i(struct ntfs_inode *ni, const s64 newsize, unsigned int
         * which is what Windows NT4 does, too.
         */
        if (NInoEncrypted(ni)) {
-               pr_err("Failed to truncate encrypted attribute");
+               pr_err("Failed to truncate encrypted attribute\n");
                return -EACCES;
        }
 
        if (NInoCompressed(ni)) {
-               pr_err("Failed to truncate compressed attribute");
+               pr_err("Failed to truncate compressed attribute\n");
                return -EOPNOTSUPP;
        }
 
index b2b0a9a043a9e755de9f6a9afec22218aee45fba..5b108d0ccec7b15ce027a94f948ae8ae009f68af 100644 (file)
@@ -613,7 +613,7 @@ static int ntfs_new_attr_flags(struct ntfs_inode *ni, __le32 fattr)
                goto out;
 
        if (a->data.non_resident.data_size) {
-               pr_err("Can't change sparsed/compressed for non-empty file");
+               pr_err("Can't change sparsed/compressed for non-empty file\n");
                err = -EOPNOTSUPP;
                goto err_out;
        }
index c844845f627cd15edc2525832ce65fa895711bd5..28d3cb16da0102cc2b186ec81e149cc48454ff40 100644 (file)
@@ -1598,7 +1598,7 @@ int ntfs_rl_sparse(struct runlist_element *rl)
        for (rlc = rl; rlc->length; rlc++)
                if (rlc->lcn < 0) {
                        if (rlc->lcn != LCN_HOLE && rlc->lcn != LCN_DELALLOC) {
-                               pr_err("%s: bad runlist", __func__);
+                               pr_err("%s: bad runlist\n", __func__);
                                return -EINVAL;
                        }
                        return 1;