0001
0002
0003
0004
0005
0006
0007
0008 #ifdef NTFS_RW
0009
0010 #include <linux/types.h>
0011 #include <linux/fs.h>
0012 #include <linux/highmem.h>
0013 #include <linux/buffer_head.h>
0014 #include <linux/bitops.h>
0015 #include <linux/log2.h>
0016 #include <linux/bio.h>
0017
0018 #include "attrib.h"
0019 #include "aops.h"
0020 #include "debug.h"
0021 #include "logfile.h"
0022 #include "malloc.h"
0023 #include "volume.h"
0024 #include "ntfs.h"
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 static bool ntfs_check_restart_page_header(struct inode *vi,
0039 RESTART_PAGE_HEADER *rp, s64 pos)
0040 {
0041 u32 logfile_system_page_size, logfile_log_page_size;
0042 u16 ra_ofs, usa_count, usa_ofs, usa_end = 0;
0043 bool have_usa = true;
0044
0045 ntfs_debug("Entering.");
0046
0047
0048
0049
0050 logfile_system_page_size = le32_to_cpu(rp->system_page_size);
0051 logfile_log_page_size = le32_to_cpu(rp->log_page_size);
0052 if (logfile_system_page_size < NTFS_BLOCK_SIZE ||
0053 logfile_log_page_size < NTFS_BLOCK_SIZE ||
0054 logfile_system_page_size &
0055 (logfile_system_page_size - 1) ||
0056 !is_power_of_2(logfile_log_page_size)) {
0057 ntfs_error(vi->i_sb, "$LogFile uses unsupported page size.");
0058 return false;
0059 }
0060
0061
0062
0063
0064 if (pos && pos != logfile_system_page_size) {
0065 ntfs_error(vi->i_sb, "Found restart area in incorrect "
0066 "position in $LogFile.");
0067 return false;
0068 }
0069
0070 if (sle16_to_cpu(rp->major_ver) != 1 ||
0071 sle16_to_cpu(rp->minor_ver) != 1) {
0072 ntfs_error(vi->i_sb, "$LogFile version %i.%i is not "
0073 "supported. (This driver supports version "
0074 "1.1 only.)", (int)sle16_to_cpu(rp->major_ver),
0075 (int)sle16_to_cpu(rp->minor_ver));
0076 return false;
0077 }
0078
0079
0080
0081
0082 if (ntfs_is_chkd_record(rp->magic) && !le16_to_cpu(rp->usa_count)) {
0083 have_usa = false;
0084 goto skip_usa_checks;
0085 }
0086
0087 usa_count = 1 + (logfile_system_page_size >> NTFS_BLOCK_SIZE_BITS);
0088 if (usa_count != le16_to_cpu(rp->usa_count)) {
0089 ntfs_error(vi->i_sb, "$LogFile restart page specifies "
0090 "inconsistent update sequence array count.");
0091 return false;
0092 }
0093
0094 usa_ofs = le16_to_cpu(rp->usa_ofs);
0095 usa_end = usa_ofs + usa_count * sizeof(u16);
0096 if (usa_ofs < sizeof(RESTART_PAGE_HEADER) ||
0097 usa_end > NTFS_BLOCK_SIZE - sizeof(u16)) {
0098 ntfs_error(vi->i_sb, "$LogFile restart page specifies "
0099 "inconsistent update sequence array offset.");
0100 return false;
0101 }
0102 skip_usa_checks:
0103
0104
0105
0106
0107
0108
0109 ra_ofs = le16_to_cpu(rp->restart_area_offset);
0110 if (ra_ofs & 7 || (have_usa ? ra_ofs < usa_end :
0111 ra_ofs < sizeof(RESTART_PAGE_HEADER)) ||
0112 ra_ofs > logfile_system_page_size) {
0113 ntfs_error(vi->i_sb, "$LogFile restart page specifies "
0114 "inconsistent restart area offset.");
0115 return false;
0116 }
0117
0118
0119
0120
0121 if (!ntfs_is_chkd_record(rp->magic) && sle64_to_cpu(rp->chkdsk_lsn)) {
0122 ntfs_error(vi->i_sb, "$LogFile restart page is not modified "
0123 "by chkdsk but a chkdsk LSN is specified.");
0124 return false;
0125 }
0126 ntfs_debug("Done.");
0127 return true;
0128 }
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 static bool ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
0145 {
0146 u64 file_size;
0147 RESTART_AREA *ra;
0148 u16 ra_ofs, ra_len, ca_ofs;
0149 u8 fs_bits;
0150
0151 ntfs_debug("Entering.");
0152 ra_ofs = le16_to_cpu(rp->restart_area_offset);
0153 ra = (RESTART_AREA*)((u8*)rp + ra_ofs);
0154
0155
0156
0157
0158
0159 if (ra_ofs + offsetof(RESTART_AREA, file_size) >
0160 NTFS_BLOCK_SIZE - sizeof(u16)) {
0161 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
0162 "inconsistent file offset.");
0163 return false;
0164 }
0165
0166
0167
0168
0169
0170
0171
0172 ca_ofs = le16_to_cpu(ra->client_array_offset);
0173 if (((ca_ofs + 7) & ~7) != ca_ofs ||
0174 ra_ofs + ca_ofs > NTFS_BLOCK_SIZE - sizeof(u16)) {
0175 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
0176 "inconsistent client array offset.");
0177 return false;
0178 }
0179
0180
0181
0182
0183
0184 ra_len = ca_ofs + le16_to_cpu(ra->log_clients) *
0185 sizeof(LOG_CLIENT_RECORD);
0186 if (ra_ofs + ra_len > le32_to_cpu(rp->system_page_size) ||
0187 ra_ofs + le16_to_cpu(ra->restart_area_length) >
0188 le32_to_cpu(rp->system_page_size) ||
0189 ra_len > le16_to_cpu(ra->restart_area_length)) {
0190 ntfs_error(vi->i_sb, "$LogFile restart area is out of bounds "
0191 "of the system page size specified by the "
0192 "restart page header and/or the specified "
0193 "restart area length is inconsistent.");
0194 return false;
0195 }
0196
0197
0198
0199
0200
0201 if ((ra->client_free_list != LOGFILE_NO_CLIENT &&
0202 le16_to_cpu(ra->client_free_list) >=
0203 le16_to_cpu(ra->log_clients)) ||
0204 (ra->client_in_use_list != LOGFILE_NO_CLIENT &&
0205 le16_to_cpu(ra->client_in_use_list) >=
0206 le16_to_cpu(ra->log_clients))) {
0207 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
0208 "overflowing client free and/or in use lists.");
0209 return false;
0210 }
0211
0212
0213
0214
0215 file_size = (u64)sle64_to_cpu(ra->file_size);
0216 fs_bits = 0;
0217 while (file_size) {
0218 file_size >>= 1;
0219 fs_bits++;
0220 }
0221 if (le32_to_cpu(ra->seq_number_bits) != 67 - fs_bits) {
0222 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
0223 "inconsistent sequence number bits.");
0224 return false;
0225 }
0226
0227 if (((le16_to_cpu(ra->log_record_header_length) + 7) & ~7) !=
0228 le16_to_cpu(ra->log_record_header_length)) {
0229 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
0230 "inconsistent log record header length.");
0231 return false;
0232 }
0233
0234 if (((le16_to_cpu(ra->log_page_data_offset) + 7) & ~7) !=
0235 le16_to_cpu(ra->log_page_data_offset)) {
0236 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
0237 "inconsistent log page data offset.");
0238 return false;
0239 }
0240 ntfs_debug("Done.");
0241 return true;
0242 }
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256
0257
0258
0259 static bool ntfs_check_log_client_array(struct inode *vi,
0260 RESTART_PAGE_HEADER *rp)
0261 {
0262 RESTART_AREA *ra;
0263 LOG_CLIENT_RECORD *ca, *cr;
0264 u16 nr_clients, idx;
0265 bool in_free_list, idx_is_first;
0266
0267 ntfs_debug("Entering.");
0268 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset));
0269 ca = (LOG_CLIENT_RECORD*)((u8*)ra +
0270 le16_to_cpu(ra->client_array_offset));
0271
0272
0273
0274
0275
0276
0277
0278
0279 nr_clients = le16_to_cpu(ra->log_clients);
0280 idx = le16_to_cpu(ra->client_free_list);
0281 in_free_list = true;
0282 check_list:
0283 for (idx_is_first = true; idx != LOGFILE_NO_CLIENT_CPU; nr_clients--,
0284 idx = le16_to_cpu(cr->next_client)) {
0285 if (!nr_clients || idx >= le16_to_cpu(ra->log_clients))
0286 goto err_out;
0287
0288 cr = ca + idx;
0289
0290 if (idx_is_first) {
0291 if (cr->prev_client != LOGFILE_NO_CLIENT)
0292 goto err_out;
0293 idx_is_first = false;
0294 }
0295 }
0296
0297 if (in_free_list) {
0298 in_free_list = false;
0299 idx = le16_to_cpu(ra->client_in_use_list);
0300 goto check_list;
0301 }
0302 ntfs_debug("Done.");
0303 return true;
0304 err_out:
0305 ntfs_error(vi->i_sb, "$LogFile log client array is corrupt.");
0306 return false;
0307 }
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336 static int ntfs_check_and_load_restart_page(struct inode *vi,
0337 RESTART_PAGE_HEADER *rp, s64 pos, RESTART_PAGE_HEADER **wrp,
0338 LSN *lsn)
0339 {
0340 RESTART_AREA *ra;
0341 RESTART_PAGE_HEADER *trp;
0342 int size, err;
0343
0344 ntfs_debug("Entering.");
0345
0346 if (!ntfs_check_restart_page_header(vi, rp, pos)) {
0347
0348 return -EINVAL;
0349 }
0350
0351 if (!ntfs_check_restart_area(vi, rp)) {
0352
0353 return -EINVAL;
0354 }
0355 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset));
0356
0357
0358
0359
0360 trp = ntfs_malloc_nofs(le32_to_cpu(rp->system_page_size));
0361 if (!trp) {
0362 ntfs_error(vi->i_sb, "Failed to allocate memory for $LogFile "
0363 "restart page buffer.");
0364 return -ENOMEM;
0365 }
0366
0367
0368
0369
0370
0371 size = PAGE_SIZE - (pos & ~PAGE_MASK);
0372 if (size >= le32_to_cpu(rp->system_page_size)) {
0373 memcpy(trp, rp, le32_to_cpu(rp->system_page_size));
0374 } else {
0375 pgoff_t idx;
0376 struct page *page;
0377 int have_read, to_read;
0378
0379
0380 memcpy(trp, rp, size);
0381
0382 have_read = size;
0383 to_read = le32_to_cpu(rp->system_page_size) - size;
0384 idx = (pos + size) >> PAGE_SHIFT;
0385 BUG_ON((pos + size) & ~PAGE_MASK);
0386 do {
0387 page = ntfs_map_page(vi->i_mapping, idx);
0388 if (IS_ERR(page)) {
0389 ntfs_error(vi->i_sb, "Error mapping $LogFile "
0390 "page (index %lu).", idx);
0391 err = PTR_ERR(page);
0392 if (err != -EIO && err != -ENOMEM)
0393 err = -EIO;
0394 goto err_out;
0395 }
0396 size = min_t(int, to_read, PAGE_SIZE);
0397 memcpy((u8*)trp + have_read, page_address(page), size);
0398 ntfs_unmap_page(page);
0399 have_read += size;
0400 to_read -= size;
0401 idx++;
0402 } while (to_read > 0);
0403 }
0404
0405
0406
0407
0408 if ((!ntfs_is_chkd_record(trp->magic) || le16_to_cpu(trp->usa_count))
0409 && post_read_mst_fixup((NTFS_RECORD*)trp,
0410 le32_to_cpu(rp->system_page_size))) {
0411
0412
0413
0414
0415
0416 if (le16_to_cpu(rp->restart_area_offset) +
0417 le16_to_cpu(ra->restart_area_length) >
0418 NTFS_BLOCK_SIZE - sizeof(u16)) {
0419 ntfs_error(vi->i_sb, "Multi sector transfer error "
0420 "detected in $LogFile restart page.");
0421 err = -EINVAL;
0422 goto err_out;
0423 }
0424 }
0425
0426
0427
0428
0429
0430 err = 0;
0431 if (ntfs_is_rstr_record(rp->magic) &&
0432 ra->client_in_use_list != LOGFILE_NO_CLIENT) {
0433 if (!ntfs_check_log_client_array(vi, trp)) {
0434 err = -EINVAL;
0435 goto err_out;
0436 }
0437 }
0438 if (lsn) {
0439 if (ntfs_is_rstr_record(rp->magic))
0440 *lsn = sle64_to_cpu(ra->current_lsn);
0441 else
0442 *lsn = sle64_to_cpu(rp->chkdsk_lsn);
0443 }
0444 ntfs_debug("Done.");
0445 if (wrp)
0446 *wrp = trp;
0447 else {
0448 err_out:
0449 ntfs_free(trp);
0450 }
0451 return err;
0452 }
0453
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470
0471 bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
0472 {
0473 s64 size, pos;
0474 LSN rstr1_lsn, rstr2_lsn;
0475 ntfs_volume *vol = NTFS_SB(log_vi->i_sb);
0476 struct address_space *mapping = log_vi->i_mapping;
0477 struct page *page = NULL;
0478 u8 *kaddr = NULL;
0479 RESTART_PAGE_HEADER *rstr1_ph = NULL;
0480 RESTART_PAGE_HEADER *rstr2_ph = NULL;
0481 int log_page_size, err;
0482 bool logfile_is_empty = true;
0483 u8 log_page_bits;
0484
0485 ntfs_debug("Entering.");
0486
0487 if (NVolLogFileEmpty(vol))
0488 goto is_empty;
0489 size = i_size_read(log_vi);
0490
0491 if (size > MaxLogFileSize)
0492 size = MaxLogFileSize;
0493
0494
0495
0496
0497
0498
0499 if (PAGE_SIZE >= DefaultLogPageSize && PAGE_SIZE <=
0500 DefaultLogPageSize * 2)
0501 log_page_size = DefaultLogPageSize;
0502 else
0503 log_page_size = PAGE_SIZE;
0504
0505
0506
0507
0508 log_page_bits = ntfs_ffs(log_page_size) - 1;
0509 size &= ~(s64)(log_page_size - 1);
0510
0511
0512
0513
0514 if (size < log_page_size * 2 || (size - log_page_size * 2) >>
0515 log_page_bits < MinLogRecordPages) {
0516 ntfs_error(vol->sb, "$LogFile is too small.");
0517 return false;
0518 }
0519
0520
0521
0522
0523
0524
0525
0526
0527 for (pos = 0; pos < size; pos <<= 1) {
0528 pgoff_t idx = pos >> PAGE_SHIFT;
0529 if (!page || page->index != idx) {
0530 if (page)
0531 ntfs_unmap_page(page);
0532 page = ntfs_map_page(mapping, idx);
0533 if (IS_ERR(page)) {
0534 ntfs_error(vol->sb, "Error mapping $LogFile "
0535 "page (index %lu).", idx);
0536 goto err_out;
0537 }
0538 }
0539 kaddr = (u8*)page_address(page) + (pos & ~PAGE_MASK);
0540
0541
0542
0543
0544
0545 if (!ntfs_is_empty_recordp((le32*)kaddr))
0546 logfile_is_empty = false;
0547 else if (!logfile_is_empty)
0548 break;
0549
0550
0551
0552
0553 if (ntfs_is_rcrd_recordp((le32*)kaddr))
0554 break;
0555
0556 if (!ntfs_is_rstr_recordp((le32*)kaddr) &&
0557 !ntfs_is_chkd_recordp((le32*)kaddr)) {
0558 if (!pos)
0559 pos = NTFS_BLOCK_SIZE >> 1;
0560 continue;
0561 }
0562
0563
0564
0565
0566
0567 err = ntfs_check_and_load_restart_page(log_vi,
0568 (RESTART_PAGE_HEADER*)kaddr, pos,
0569 !rstr1_ph ? &rstr1_ph : &rstr2_ph,
0570 !rstr1_ph ? &rstr1_lsn : &rstr2_lsn);
0571 if (!err) {
0572
0573
0574
0575
0576 if (!pos) {
0577 pos = NTFS_BLOCK_SIZE >> 1;
0578 continue;
0579 }
0580
0581
0582
0583
0584 break;
0585 }
0586
0587
0588
0589
0590
0591 if (err != -EINVAL) {
0592 ntfs_unmap_page(page);
0593 goto err_out;
0594 }
0595
0596 if (!pos)
0597 pos = NTFS_BLOCK_SIZE >> 1;
0598 }
0599 if (page)
0600 ntfs_unmap_page(page);
0601 if (logfile_is_empty) {
0602 NVolSetLogFileEmpty(vol);
0603 is_empty:
0604 ntfs_debug("Done. ($LogFile is empty.)");
0605 return true;
0606 }
0607 if (!rstr1_ph) {
0608 BUG_ON(rstr2_ph);
0609 ntfs_error(vol->sb, "Did not find any restart pages in "
0610 "$LogFile and it was not empty.");
0611 return false;
0612 }
0613
0614 if (rstr2_ph) {
0615
0616
0617
0618
0619 if (rstr2_lsn > rstr1_lsn) {
0620 ntfs_debug("Using second restart page as it is more "
0621 "recent.");
0622 ntfs_free(rstr1_ph);
0623 rstr1_ph = rstr2_ph;
0624
0625 } else {
0626 ntfs_debug("Using first restart page as it is more "
0627 "recent.");
0628 ntfs_free(rstr2_ph);
0629 }
0630 rstr2_ph = NULL;
0631 }
0632
0633 if (rp)
0634 *rp = rstr1_ph;
0635 else
0636 ntfs_free(rstr1_ph);
0637 ntfs_debug("Done.");
0638 return true;
0639 err_out:
0640 if (rstr1_ph)
0641 ntfs_free(rstr1_ph);
0642 return false;
0643 }
0644
0645
0646
0647
0648
0649
0650
0651
0652
0653
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664
0665 bool ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp)
0666 {
0667 ntfs_volume *vol = NTFS_SB(log_vi->i_sb);
0668 RESTART_AREA *ra;
0669
0670 ntfs_debug("Entering.");
0671
0672 if (NVolLogFileEmpty(vol)) {
0673 ntfs_debug("Done. ($LogFile is empty.)");
0674 return true;
0675 }
0676 BUG_ON(!rp);
0677 if (!ntfs_is_rstr_record(rp->magic) &&
0678 !ntfs_is_chkd_record(rp->magic)) {
0679 ntfs_error(vol->sb, "Restart page buffer is invalid. This is "
0680 "probably a bug in that the $LogFile should "
0681 "have been consistency checked before calling "
0682 "this function.");
0683 return false;
0684 }
0685 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset));
0686
0687
0688
0689
0690
0691 if (ra->client_in_use_list != LOGFILE_NO_CLIENT &&
0692 !(ra->flags & RESTART_VOLUME_IS_CLEAN)) {
0693 ntfs_debug("Done. $LogFile indicates a dirty shutdown.");
0694 return false;
0695 }
0696
0697 ntfs_debug("Done. $LogFile indicates a clean shutdown.");
0698 return true;
0699 }
0700
0701
0702
0703
0704
0705
0706
0707
0708
0709
0710
0711
0712 bool ntfs_empty_logfile(struct inode *log_vi)
0713 {
0714 VCN vcn, end_vcn;
0715 ntfs_inode *log_ni = NTFS_I(log_vi);
0716 ntfs_volume *vol = log_ni->vol;
0717 struct super_block *sb = vol->sb;
0718 runlist_element *rl;
0719 unsigned long flags;
0720 unsigned block_size, block_size_bits;
0721 int err;
0722 bool should_wait = true;
0723
0724 ntfs_debug("Entering.");
0725 if (NVolLogFileEmpty(vol)) {
0726 ntfs_debug("Done.");
0727 return true;
0728 }
0729
0730
0731
0732
0733
0734
0735
0736 block_size = sb->s_blocksize;
0737 block_size_bits = sb->s_blocksize_bits;
0738 vcn = 0;
0739 read_lock_irqsave(&log_ni->size_lock, flags);
0740 end_vcn = (log_ni->initialized_size + vol->cluster_size_mask) >>
0741 vol->cluster_size_bits;
0742 read_unlock_irqrestore(&log_ni->size_lock, flags);
0743 truncate_inode_pages(log_vi->i_mapping, 0);
0744 down_write(&log_ni->runlist.lock);
0745 rl = log_ni->runlist.rl;
0746 if (unlikely(!rl || vcn < rl->vcn || !rl->length)) {
0747 map_vcn:
0748 err = ntfs_map_runlist_nolock(log_ni, vcn, NULL);
0749 if (err) {
0750 ntfs_error(sb, "Failed to map runlist fragment (error "
0751 "%d).", -err);
0752 goto err;
0753 }
0754 rl = log_ni->runlist.rl;
0755 BUG_ON(!rl || vcn < rl->vcn || !rl->length);
0756 }
0757
0758 while (rl->length && vcn >= rl[1].vcn)
0759 rl++;
0760 do {
0761 LCN lcn;
0762 sector_t block, end_block;
0763 s64 len;
0764
0765
0766
0767
0768
0769 lcn = rl->lcn;
0770 if (unlikely(lcn == LCN_RL_NOT_MAPPED)) {
0771 vcn = rl->vcn;
0772 goto map_vcn;
0773 }
0774
0775 if (unlikely(!rl->length || lcn < LCN_HOLE))
0776 goto rl_err;
0777
0778 if (lcn == LCN_HOLE)
0779 continue;
0780 block = lcn << vol->cluster_size_bits >> block_size_bits;
0781 len = rl->length;
0782 if (rl[1].vcn > end_vcn)
0783 len = end_vcn - rl->vcn;
0784 end_block = (lcn + len) << vol->cluster_size_bits >>
0785 block_size_bits;
0786
0787 do {
0788 struct buffer_head *bh;
0789
0790
0791 bh = sb_getblk(sb, block);
0792 BUG_ON(!bh);
0793
0794 lock_buffer(bh);
0795 bh->b_end_io = end_buffer_write_sync;
0796 get_bh(bh);
0797
0798 memset(bh->b_data, -1, block_size);
0799 if (!buffer_uptodate(bh))
0800 set_buffer_uptodate(bh);
0801 if (buffer_dirty(bh))
0802 clear_buffer_dirty(bh);
0803
0804
0805
0806
0807
0808
0809
0810 submit_bh(REQ_OP_WRITE, bh);
0811 if (should_wait) {
0812 should_wait = false;
0813 wait_on_buffer(bh);
0814 if (unlikely(!buffer_uptodate(bh)))
0815 goto io_err;
0816 }
0817 brelse(bh);
0818 } while (++block < end_block);
0819 } while ((++rl)->vcn < end_vcn);
0820 up_write(&log_ni->runlist.lock);
0821
0822
0823
0824
0825
0826
0827
0828
0829 truncate_inode_pages(log_vi->i_mapping, 0);
0830
0831 NVolSetLogFileEmpty(vol);
0832 ntfs_debug("Done.");
0833 return true;
0834 io_err:
0835 ntfs_error(sb, "Failed to write buffer. Unmount and run chkdsk.");
0836 goto dirty_err;
0837 rl_err:
0838 ntfs_error(sb, "Runlist is corrupt. Unmount and run chkdsk.");
0839 dirty_err:
0840 NVolSetErrors(vol);
0841 err = -EIO;
0842 err:
0843 up_write(&log_ni->runlist.lock);
0844 ntfs_error(sb, "Failed to fill $LogFile with 0xff bytes (error %d).",
0845 -err);
0846 return false;
0847 }
0848
0849 #endif