Skip to content

Commit 217114c

Browse files
konisgregkh
authored andcommitted
nilfs2: do not output warnings when clearing dirty buffers
commit 299910dcb4525ac0274f3efa9527876315ba4f67 upstream. After detecting file system corruption and degrading to a read-only mount, dirty folios and buffers in the page cache are cleared, and a large number of warnings are output at that time, often filling up the kernel log. In this case, since the degrading to a read-only mount is output to the kernel log, these warnings are not very meaningful, and are rather a nuisance in system management and debugging. The related nilfs2-specific page/folio routines have a silent argument that suppresses the warning output, but since it is not currently used meaningfully, remove both the silent argument and the warning output. [[email protected]: adjusted for page/folio conversion] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ryusuke Konishi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Stable-dep-of: ca76bb226bf4 ("nilfs2: do not force clear folio if buffer is referenced") Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2a21bad commit 217114c

File tree

4 files changed

+10
-24
lines changed

4 files changed

+10
-24
lines changed

fs/nilfs2/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static int nilfs_writepages(struct address_space *mapping,
162162
int err = 0;
163163

164164
if (sb_rdonly(inode->i_sb)) {
165-
nilfs_clear_dirty_pages(mapping, false);
165+
nilfs_clear_dirty_pages(mapping);
166166
return -EROFS;
167167
}
168168

@@ -185,7 +185,7 @@ static int nilfs_writepage(struct page *page, struct writeback_control *wbc)
185185
* have dirty pages that try to be flushed in background.
186186
* So, here we simply discard this dirty page.
187187
*/
188-
nilfs_clear_dirty_page(page, false);
188+
nilfs_clear_dirty_page(page);
189189
unlock_page(page);
190190
return -EROFS;
191191
}

fs/nilfs2/mdt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc)
411411
* have dirty pages that try to be flushed in background.
412412
* So, here we simply discard this dirty page.
413413
*/
414-
nilfs_clear_dirty_page(page, false);
414+
nilfs_clear_dirty_page(page);
415415
unlock_page(page);
416416
return -EROFS;
417417
}
@@ -634,10 +634,10 @@ void nilfs_mdt_restore_from_shadow_map(struct inode *inode)
634634
if (mi->mi_palloc_cache)
635635
nilfs_palloc_clear_cache(inode);
636636

637-
nilfs_clear_dirty_pages(inode->i_mapping, true);
637+
nilfs_clear_dirty_pages(inode->i_mapping);
638638
nilfs_copy_back_pages(inode->i_mapping, shadow->inode->i_mapping);
639639

640-
nilfs_clear_dirty_pages(ii->i_assoc_inode->i_mapping, true);
640+
nilfs_clear_dirty_pages(ii->i_assoc_inode->i_mapping);
641641
nilfs_copy_back_pages(ii->i_assoc_inode->i_mapping,
642642
NILFS_I(shadow->inode)->i_assoc_inode->i_mapping);
643643

fs/nilfs2/page.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,8 @@ void nilfs_copy_back_pages(struct address_space *dmap,
354354
/**
355355
* nilfs_clear_dirty_pages - discard dirty pages in address space
356356
* @mapping: address space with dirty pages for discarding
357-
* @silent: suppress [true] or print [false] warning messages
358357
*/
359-
void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent)
358+
void nilfs_clear_dirty_pages(struct address_space *mapping)
360359
{
361360
struct pagevec pvec;
362361
unsigned int i;
@@ -377,7 +376,7 @@ void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent)
377376
* was acquired. Skip processing in that case.
378377
*/
379378
if (likely(page->mapping == mapping))
380-
nilfs_clear_dirty_page(page, silent);
379+
nilfs_clear_dirty_page(page);
381380

382381
unlock_page(page);
383382
}
@@ -389,19 +388,11 @@ void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent)
389388
/**
390389
* nilfs_clear_dirty_page - discard dirty page
391390
* @page: dirty page that will be discarded
392-
* @silent: suppress [true] or print [false] warning messages
393391
*/
394-
void nilfs_clear_dirty_page(struct page *page, bool silent)
392+
void nilfs_clear_dirty_page(struct page *page)
395393
{
396-
struct inode *inode = page->mapping->host;
397-
struct super_block *sb = inode->i_sb;
398-
399394
BUG_ON(!PageLocked(page));
400395

401-
if (!silent)
402-
nilfs_warn(sb, "discard dirty page: offset=%lld, ino=%lu",
403-
page_offset(page), inode->i_ino);
404-
405396
ClearPageUptodate(page);
406397
ClearPageMappedToDisk(page);
407398
ClearPageChecked(page);
@@ -417,11 +408,6 @@ void nilfs_clear_dirty_page(struct page *page, bool silent)
417408
bh = head = page_buffers(page);
418409
do {
419410
lock_buffer(bh);
420-
if (!silent)
421-
nilfs_warn(sb,
422-
"discard dirty block: blocknr=%llu, size=%zu",
423-
(u64)bh->b_blocknr, bh->b_size);
424-
425411
set_mask_bits(&bh->b_state, clear_bits, 0);
426412
unlock_buffer(bh);
427413
} while (bh = bh->b_this_page, bh != head);

fs/nilfs2/page.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ void nilfs_page_bug(struct page *);
4141

4242
int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
4343
void nilfs_copy_back_pages(struct address_space *, struct address_space *);
44-
void nilfs_clear_dirty_page(struct page *, bool);
45-
void nilfs_clear_dirty_pages(struct address_space *, bool);
44+
void nilfs_clear_dirty_page(struct page *page);
45+
void nilfs_clear_dirty_pages(struct address_space *mapping);
4646
unsigned int nilfs_page_count_clean_buffers(struct page *, unsigned int,
4747
unsigned int);
4848
unsigned long nilfs_find_uncommitted_extent(struct inode *inode,

0 commit comments

Comments
 (0)