diff mbox series

btrfs:zoned: Fix comment description for sb_write_pointer logic

Message ID 20220517082255.28547-1-p.raghav@samsung.com (mailing list archive)
State New, archived
Headers show
Series btrfs:zoned: Fix comment description for sb_write_pointer logic | expand

Commit Message

Pankaj Raghav May 17, 2022, 8:22 a.m. UTC
The comments describing the logic for evaluating the sb write pointer
does not represent what is done in the code. Fix it to represent the
actual logic used.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 fs/btrfs/zoned.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

David Sterba May 17, 2022, 12:13 p.m. UTC | #1
On Tue, May 17, 2022 at 10:22:55AM +0200, Pankaj Raghav wrote:
> The comments describing the logic for evaluating the sb write pointer
> does not represent what is done in the code. Fix it to represent the
> actual logic used.

It would be good to briefly describe what is the actual mistake in the
comment, so one can have an idea without looking to the code.
Pankaj Raghav May 17, 2022, 12:25 p.m. UTC | #2
On 2022-05-17 14:13, David Sterba wrote:
> On Tue, May 17, 2022 at 10:22:55AM +0200, Pankaj Raghav wrote:
>> The comments describing the logic for evaluating the sb write pointer
>> does not represent what is done in the code. Fix it to represent the
>> actual logic used.
> 
> It would be good to briefly describe what is the actual mistake in the
> comment, so one can have an idea without looking to the code.
I should have done that. I will send a v2 with a more descriptive commit
log. Thanks
Johannes Thumshirn May 17, 2022, 2:16 p.m. UTC | #3
With the commit log updated,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 057babaa3e05..c09b1b0208c4 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -94,9 +94,9 @@  static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
 	 * Possible states of log buffer zones
 	 *
 	 *           Empty[0]  In use[0]  Full[0]
-	 * Empty[1]         *          x        0
-	 * In use[1]        0          x        0
-	 * Full[1]          1          1        C
+	 * Empty[1]         *          0        1
+	 * In use[1]        x          x        1
+	 * Full[1]          0          0        C
 	 *
 	 * Log position:
 	 *   *: Special case, no superblock is written