lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 3 Feb 2021 14:14:50 +0800
From:   Shaokun Zhang <>
To:     <>, <>
CC:     Yang Guo <>,
        Alexander Viro <>,
        Andrew Morton <>,
        Nick Piggin <>,
        Shaokun Zhang <>
Subject: [PATCH] fs/buffer.c: Add checking buffer head stat before clear

From: Yang Guo <>

clear_buffer_new() is used to clear buffer new stat. When PAGE_SIZE
is 64K, most buffer heads in the list are not needed to clear.
clear_buffer_new() has an enpensive atomic modification operation,
Let's add checking buffer head before clear it as __block_write_begin_int
does which is good for performance.

Cc: Alexander Viro <>
Cc: Andrew Morton <>
Cc: Nick Piggin <>
Signed-off-by: Yang Guo <>
Signed-off-by: Shaokun Zhang <>
 fs/buffer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 32647d2011df..f1c3a5b27a90 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2083,7 +2083,8 @@ static int __block_commit_write(struct inode *inode, struct page *page,
-		clear_buffer_new(bh);
+		if (buffer_new(bh))
+			clear_buffer_new(bh);
 		block_start = block_end;
 		bh = bh->b_this_page;

Powered by blists - more mailing lists