Message ID | 20240812223836.GB6051@frogsfrogsfrogs (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | libxfs: dirty buffers should be marked uptodate too | expand |
On Mon, Aug 12, 2024 at 03:38:36PM -0700, Darrick J. Wong wrote: > Hence change both buffer dirtying functions to set UPTODATE, since a > dirty buffer is by definition at least as recent as whatever's on disk. This also matches what the kernel does in xfs_trans_dirty_buf ( except that it weirdly spells the uptodate flag done..) and other page / buffer caches: Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index bd773a7375bc..35be785c435a 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -919,7 +919,7 @@ libxfs_buf_mark_dirty( */ bp->b_error = 0; bp->b_flags &= ~LIBXFS_B_STALE; - bp->b_flags |= LIBXFS_B_DIRTY; + bp->b_flags |= LIBXFS_B_DIRTY | LIBXFS_B_UPTODATE; } /* Prepare a buffer to be sent to the MRU list. */ diff --git a/libxfs/trans.c b/libxfs/trans.c index b5f6081a16cb..5c896ba1661b 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -716,6 +716,7 @@ libxfs_trans_dirty_buf( ASSERT(bp->b_transp == tp); ASSERT(bip != NULL); + bp->b_flags |= LIBXFS_B_UPTODATE; tp->t_flags |= XFS_TRANS_DIRTY; set_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags); }