All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix comments and spaces to follow coding style
@ 2021-07-06 18:39 Jan Gruber
  2021-07-06 19:20 ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Gruber @ 2021-07-06 18:39 UTC (permalink / raw)
  To: tytso, adilger.kernel; +Cc: trivial, linux-ext4, linux-kernel, Jan Gruber

This commit addresses two whitespace issues as well as
instances of the following coding style issue regarding
block comments, which were identified by checkpatch.pl:

"WARNING: Block comments use a trailing */ on a separate line"

The changes aim at making the code more pleasant to read
and to eliminate warnings

Signed-off-by: Jan Gruber <j4n6ru@gmail.com>
---
 fs/ext4/super.c | 55 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 36 insertions(+), 19 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9b2e8fc86346..5250c7debbad 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -514,7 +514,7 @@ static int ext4_journalled_submit_inode_data_buffers(struct jbd2_inode *jinode)
 		.nr_to_write = LONG_MAX,
 		.range_start = jinode->i_dirty_start,
 		.range_end = jinode->i_dirty_end,
-        };
+	};
 
 	return write_cache_pages(mapping, &wbc,
 				 ext4_journalled_writepage_callback,
@@ -850,9 +850,11 @@ const char *ext4_decode_error(struct super_block *sb, int errno,
 			errstr = "Readonly filesystem";
 		break;
 	default:
-		/* If the caller passed in an extra buffer for unknown
+		/*
+		 * If the caller passed in an extra buffer for unknown
 		 * errors, textualise them now.  Else we just return
-		 * NULL. */
+		 * NULL.
+		 */
 		if (nbuf) {
 			/* Check for truncated error codes... */
 			if (snprintf(nbuf, 16, "error %d", -errno) >= 0)
@@ -864,8 +866,10 @@ const char *ext4_decode_error(struct super_block *sb, int errno,
 	return errstr;
 }
 
-/* __ext4_std_error decodes expected errors from journaling functions
- * automatically and invokes the appropriate error response.  */
+/*
+ * __ext4_std_error decodes expected errors from journaling functions
+ * automatically and invokes the appropriate error response.
+ */
 
 void __ext4_std_error(struct super_block *sb, const char *function,
 		      unsigned int line, int errno)
@@ -876,9 +880,11 @@ void __ext4_std_error(struct super_block *sb, const char *function,
 	if (unlikely(ext4_forced_shutdown(EXT4_SB(sb))))
 		return;
 
-	/* Special case: if the error is EROFS, and we're not already
+	/*
+	 * Special case: if the error is EROFS, and we're not already
 	 * inside a transaction, then there's really no point in logging
-	 * an error. */
+	 * an error.
+	 */
 	if (errno == -EROFS && journal_current_handle() == NULL && sb_rdonly(sb))
 		return;
 
@@ -1219,10 +1225,12 @@ static void ext4_put_super(struct super_block *sb)
 		kfree(get_qf_name(sb, sbi, i));
 #endif
 
-	/* Debugging code just in case the in-memory inode orphan list
+	/*
+	 * Debugging code just in case the in-memory inode orphan list
 	 * isn't empty.  The on-disk one can be non-empty if we've
 	 * detected an error and taken the fs readonly, but the
-	 * in-memory list had better be clean by this point. */
+	 * in-memory list had better be clean by this point.
+	 */
 	if (!list_empty(&sbi->s_orphan))
 		dump_orphan_list(sb, sbi);
 	ASSERT(list_empty(&sbi->s_orphan));
@@ -4311,7 +4319,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 				 encoding_flags);
 			goto failed_mount;
 		}
-		ext4_msg(sb, KERN_INFO,"Using encoding defined by superblock: "
+		ext4_msg(sb, KERN_INFO, "Using encoding defined by superblock: "
 			 "%s-%s with flags 0x%hx", encoding_info->name,
 			 encoding_info->version?:"\b", encoding_flags);
 
@@ -4839,11 +4847,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		goto failed_mount_wq;
 	}
 
-	/* We have now updated the journal if required, so we can
-	 * validate the data journaling mode. */
+	/*
+	 * We have now updated the journal if required, so we can
+	 * validate the data journaling mode.
+	 */
 	switch (test_opt(sb, DATA_FLAGS)) {
 	case 0:
-		/* No mode set, assume a default based on the journal
+		/*
+		 * No mode set, assume a default based on the journal
 		 * capabilities: ORDERED_DATA if the journal can
 		 * cope, else JOURNAL_DATA
 		 */
@@ -6485,8 +6496,10 @@ static int ext4_quota_off(struct super_block *sb, int type)
 	handle_t *handle;
 	int err;
 
-	/* Force all delayed allocation blocks to be allocated.
-	 * Caller already holds s_umount sem */
+	/*
+	 * Force all delayed allocation blocks to be allocated.
+	 * Caller already holds s_umount sem
+	 */
 	if (test_opt(sb, DELALLOC))
 		sync_filesystem(sb);
 
@@ -6523,10 +6536,12 @@ static int ext4_quota_off(struct super_block *sb, int type)
 	return dquot_quota_off(sb, type);
 }
 
-/* Read data from quotafile - avoid pagecache and such because we cannot afford
+/*
+ * Read data from quotafile - avoid pagecache and such because we cannot afford
  * acquiring the locks... As quota files are never truncated and quota code
  * itself serializes the operations (and no one else should touch the files)
- * we don't have to be afraid of races */
+ * we don't have to be afraid of races
+ */
 static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
 			       size_t len, loff_t off)
 {
@@ -6562,8 +6577,10 @@ static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
 	return len;
 }
 
-/* Write to quotafile (we know the transaction is already started and has
- * enough credits) */
+/*
+ * Write to quotafile, we know, that the transaction was already started
+ * and has enough credits.
+ */
 static ssize_t ext4_quota_write(struct super_block *sb, int type,
 				const char *data, size_t len, loff_t off)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Fix comments and spaces to follow coding style
  2021-07-06 18:39 [PATCH] ext4: Fix comments and spaces to follow coding style Jan Gruber
@ 2021-07-06 19:20 ` Theodore Ts'o
  2021-07-07  5:25   ` Jan Gru
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2021-07-06 19:20 UTC (permalink / raw)
  To: Jan Gruber; +Cc: adilger.kernel, trivial, linux-ext4, linux-kernel

On Tue, Jul 06, 2021 at 08:39:00PM +0200, Jan Gruber wrote:
> This commit addresses two whitespace issues as well as
> instances of the following coding style issue regarding
> block comments, which were identified by checkpatch.pl:
> 
> "WARNING: Block comments use a trailing */ on a separate line"
> 
> The changes aim at making the code more pleasant to read
> and to eliminate warnings
> 
> Signed-off-by: Jan Gruber <j4n6ru@gmail.com>

Please don't send "checkpatch.pl --file" patches for the ext4 file
system; if you must, please focus on files in the drivers directory,
where they are more welcome.  If developers are making changes to a
file, fixing some checkpatch.pl whines is fine, but white-sapace only
changes just obfuscates "git blame" code archology, and so the costs
far outwieghs the costs.  "Fix" is also not the right verb to use.
For more information please see [1].

[1] https://gist.github.com/17twenty/8154928

If you are looking for subtantive ways of contributing to the ext4
file system, feel free to look at various syzbot warnings[2] and try
to figure out what is going on there.

[2] https://syzkaller.appspot.com/upstream

(In some cases, the syzbot complaint has already been fixed, and it's
just a matter of letting syzbot knoww that it has since been fixed by
a particular commit.  See [3] for more details.)

[3] https://github.com/google/syzkaller/blob/master/docs/syzbot.md

Cheers,

						- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Fix comments and spaces to follow coding style
  2021-07-06 19:20 ` Theodore Ts'o
@ 2021-07-07  5:25   ` Jan Gru
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Gru @ 2021-07-07  5:25 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: adilger.kernel, trivial, linux-ext4, linux-kernel


On 06.07.21 21:20, Theodore Ts'o wrote:
> On Tue, Jul 06, 2021 at 08:39:00PM +0200, Jan Gruber wrote:
>> [...]
> Please don't send "checkpatch.pl --file" patches for the ext4 file
> system; if you must, please focus on files in the drivers directory,
> where they are more welcome.  If developers are making changes to a
> file, fixing some checkpatch.pl whines is fine, but white-sapace only
> changes just obfuscates "git blame" code archology, and so the costs
> far outwieghs the costs.  "Fix" is also not the right verb to use.
> For more information please see [1].
>
> [1] https://gist.github.com/17twenty/8154928
>
> If you are looking for subtantive ways of contributing to the ext4
> file system, feel free to look at various syzbot warnings[2] and try
> to figure out what is going on there.
>
> [2] https://syzkaller.appspot.com/upstream
>
> (In some cases, the syzbot complaint has already been fixed, and it's
> just a matter of letting syzbot knoww that it has since been fixed by
> a particular commit.  See [3] for more details.)
>
> [3] https://github.com/google/syzkaller/blob/master/docs/syzbot.md
>
> Cheers,
>
> 						- Ted

Thank you very much for the hints, Ted!

As a kernel newbie I was not aware, that it is undesirable to send
cleanup patches. I won't do that again.

I'm thankful for the provided resources, which look valuable to me.
In the future I will try to find and tackle syzbot-errors, as you
proposed.

Sorry for bothering you with a trivial cleanup-patch.

Best regards,
         Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-07  5:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 18:39 [PATCH] ext4: Fix comments and spaces to follow coding style Jan Gruber
2021-07-06 19:20 ` Theodore Ts'o
2021-07-07  5:25   ` Jan Gru

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.