diff --git a/sys/gnu/ext2fs/ext2_linux_ialloc.c b/sys/gnu/ext2fs/ext2_linux_ialloc.c index 9f2a967f47c6..2b964b26cf0b 100644 --- a/sys/gnu/ext2fs/ext2_linux_ialloc.c +++ b/sys/gnu/ext2fs/ext2_linux_ialloc.c @@ -53,8 +53,10 @@ */ void mark_buffer_dirty(struct buf *bh) { - numdirtybuffers++; - bh->b_flags |= B_DELWRI; + if (!(bh->b_flags & B_DELWRI)) { + numdirtybuffers++; + bh->b_flags |= B_DELWRI; + } bh->b_flags &= ~(B_READ | B_ERROR); } diff --git a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c index 9f2a967f47c6..2b964b26cf0b 100644 --- a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c +++ b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c @@ -53,8 +53,10 @@ */ void mark_buffer_dirty(struct buf *bh) { - numdirtybuffers++; - bh->b_flags |= B_DELWRI; + if (!(bh->b_flags & B_DELWRI)) { + numdirtybuffers++; + bh->b_flags |= B_DELWRI; + } bh->b_flags &= ~(B_READ | B_ERROR); }