diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2022-10-16 16:06:53 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2022-10-16 16:06:53 -0700 |
commit | 280330fac48280e16454cfa46c368af4812ad79c (patch) | |
tree | 18b9ed796c57e3929e50b9b03f2c6501740b03d6 /include/linux/buffer_head.h | |
parent | d0d51a97063db4704a5ef6bc978dddab1636a306 (diff) | |
parent | 4fe89d07dcc2804c8b562f6c7896a45643d34b2f (diff) |
Merge branch 'master' into mm-hotfixes-stable
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r-- | include/linux/buffer_head.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 089c9ade4325..df518c429667 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -138,6 +138,17 @@ BUFFER_FNS(Defer_Completion, defer_completion) static __always_inline void set_buffer_uptodate(struct buffer_head *bh) { /* + * If somebody else already set this uptodate, they will + * have done the memory barrier, and a reader will thus + * see *some* valid buffer state. + * + * Any other serialization (with IO errors or whatever that + * might clear the bit) has to come from other state (eg BH_Lock). + */ + if (test_bit(BH_Uptodate, &bh->b_state)) + return; + + /* * make it consistent with folio_mark_uptodate * pairs with smp_load_acquire in buffer_uptodate */ |