Message ID | 118AAB5F26BFB34DB5CDA7DA33334DB9B6072B@vmsk-exch-01.paragon-software.com |
---|---|
State | Accepted, archived |
Headers | show |
On Thu, May 25, 2017 at 12:12:21PM +0000, Konstantin Chistyakov wrote: > Updating path: > Subject: [PATCH] e2fsck: don't flush to device opened in read-only mode Thanks, applied, with some typographical fix ups. Also, in the future please include your Developer's Certification of Origin (aka, the Signed-Off-by)[1]. In this case the patch is obvious enough (and I suggested it), that I'll apply it without it, but in the future, I'd appreicate if you could include it in your patches. [1] https://developercertificate.org/ Cheers, - Ted
diff --git a/e2fsck/unix.c b/e2fsck/unix.c index b602553..ff96148 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1898,15 +1898,17 @@ no_journal: ext2fs_mark_super_dirty(fs); } - e2fsck_write_bitmaps(ctx); - if (fs->flags & EXT2_FLAG_DIRTY) { - pctx.errcode = ext2fs_flush(ctx->fs); + if (!(ctx->options & E2F_OPT_READONLY)) { + e2fsck_write_bitmaps(ctx); + if (fs->flags & EXT2_FLAG_DIRTY) { + pctx.errcode = ext2fs_flush(ctx->fs); + if (pctx.errcode) + fix_problem(ctx, PR_6_FLUSH_FILESYSTEM, &pctx); + } + pctx.errcode = io_channel_flush(ctx->fs->io); if (pctx.errcode) - fix_problem(ctx, PR_6_FLUSH_FILESYSTEM, &pctx); + fix_problem(ctx, PR_6_IO_FLUSH, &pctx); } - pctx.errcode = io_channel_flush(ctx->fs->io); - if (pctx.errcode) - fix_problem(ctx, PR_6_IO_FLUSH, &pctx); if (was_changed) { int fs_fixed = (ctx->flags & E2F_FLAG_PROBLEMS_FIXED);