All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>,
	Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.4 5.10 5.15 1/3] nilfs2: do not output warnings when clearing dirty buffers
Date: Fri,  7 Feb 2025 17:51:31 -0500	[thread overview]
Message-ID: <20250207164045-972882c161d33629@stable.kernel.org> (raw)
In-Reply-To: <20250207142512.6129-2-konishi.ryusuke@gmail.com>

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 299910dcb4525ac0274f3efa9527876315ba4f67


Status in newer kernel trees:
6.13.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Not found
6.1.y | Not found
5.15.y | Not found

Note: The patch differs from the upstream commit:
---
1:  299910dcb4525 ! 1:  3d3719013c717 nilfs2: do not output warnings when clearing dirty buffers
    @@ Metadata
      ## Commit message ##
         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.
    @@ Commit message
         that suppresses the warning output, but since it is not currently used
         meaningfully, remove both the silent argument and the warning output.
     
    +    [konishi.ryusuke@gmail.com: adjusted for page/folio conversion]
         Link: https://lkml.kernel.org/r/20240816090128.4561-1-konishi.ryusuke@gmail.com
         Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
         Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    +    Stable-dep-of: ca76bb226bf4 ("nilfs2: do not force clear folio if buffer is referenced")
     
      ## fs/nilfs2/inode.c ##
     @@ fs/nilfs2/inode.c: static int nilfs_writepages(struct address_space *mapping,
    @@ fs/nilfs2/inode.c: static int nilfs_writepage(struct page *page, struct writebac
      		 * have dirty pages that try to be flushed in background.
      		 * So, here we simply discard this dirty page.
      		 */
    --		nilfs_clear_folio_dirty(folio, false);
    -+		nilfs_clear_folio_dirty(folio);
    - 		folio_unlock(folio);
    +-		nilfs_clear_dirty_page(page, false);
    ++		nilfs_clear_dirty_page(page);
    + 		unlock_page(page);
      		return -EROFS;
      	}
     
      ## fs/nilfs2/mdt.c ##
     @@ fs/nilfs2/mdt.c: nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc)
    - 		 * have dirty folios that try to be flushed in background.
    - 		 * So, here we simply discard this dirty folio.
    + 		 * have dirty pages that try to be flushed in background.
    + 		 * So, here we simply discard this dirty page.
      		 */
    --		nilfs_clear_folio_dirty(folio, false);
    -+		nilfs_clear_folio_dirty(folio);
    - 		folio_unlock(folio);
    +-		nilfs_clear_dirty_page(page, false);
    ++		nilfs_clear_dirty_page(page);
    + 		unlock_page(page);
      		return -EROFS;
      	}
     @@ fs/nilfs2/mdt.c: void nilfs_mdt_restore_from_shadow_map(struct inode *inode)
    @@ fs/nilfs2/page.c: void nilfs_copy_back_pages(struct address_space *dmap,
     -void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent)
     +void nilfs_clear_dirty_pages(struct address_space *mapping)
      {
    - 	struct folio_batch fbatch;
    + 	struct pagevec pvec;
      	unsigned int i;
     @@ fs/nilfs2/page.c: void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent)
      			 * was acquired.  Skip processing in that case.
      			 */
    - 			if (likely(folio->mapping == mapping))
    --				nilfs_clear_folio_dirty(folio, silent);
    -+				nilfs_clear_folio_dirty(folio);
    + 			if (likely(page->mapping == mapping))
    +-				nilfs_clear_dirty_page(page, silent);
    ++				nilfs_clear_dirty_page(page);
      
    - 			folio_unlock(folio);
    + 			unlock_page(page);
      		}
     @@ fs/nilfs2/page.c: void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent)
      /**
    -  * nilfs_clear_folio_dirty - discard dirty folio
    -  * @folio: dirty folio that will be discarded
    +  * nilfs_clear_dirty_page - discard dirty page
    +  * @page: dirty page that will be discarded
     - * @silent: suppress [true] or print [false] warning messages
       */
    --void nilfs_clear_folio_dirty(struct folio *folio, bool silent)
    -+void nilfs_clear_folio_dirty(struct folio *folio)
    +-void nilfs_clear_dirty_page(struct page *page, bool silent)
    ++void nilfs_clear_dirty_page(struct page *page)
      {
    --	struct inode *inode = folio->mapping->host;
    +-	struct inode *inode = page->mapping->host;
     -	struct super_block *sb = inode->i_sb;
    - 	struct buffer_head *bh, *head;
    - 
    - 	BUG_ON(!folio_test_locked(folio));
    +-
    + 	BUG_ON(!PageLocked(page));
      
     -	if (!silent)
     -		nilfs_warn(sb, "discard dirty page: offset=%lld, ino=%lu",
    --			   folio_pos(folio), inode->i_ino);
    +-			   page_offset(page), inode->i_ino);
     -
    - 	folio_clear_uptodate(folio);
    - 	folio_clear_mappedtodisk(folio);
    - 
    -@@ fs/nilfs2/page.c: void nilfs_clear_folio_dirty(struct folio *folio, bool silent)
    - 		bh = head;
    + 	ClearPageUptodate(page);
    + 	ClearPageMappedToDisk(page);
    + 	ClearPageChecked(page);
    +@@ fs/nilfs2/page.c: void nilfs_clear_dirty_page(struct page *page, bool silent)
    + 		bh = head = page_buffers(page);
      		do {
      			lock_buffer(bh);
     -			if (!silent)
    @@ fs/nilfs2/page.c: void nilfs_clear_folio_dirty(struct folio *folio, bool silent)
      		} while (bh = bh->b_this_page, bh != head);
     
      ## fs/nilfs2/page.h ##
    -@@ fs/nilfs2/page.h: void nilfs_folio_bug(struct folio *);
    +@@ fs/nilfs2/page.h: void nilfs_page_bug(struct page *);
      
      int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
      void nilfs_copy_back_pages(struct address_space *, struct address_space *);
    --void nilfs_clear_folio_dirty(struct folio *, bool);
    +-void nilfs_clear_dirty_page(struct page *, bool);
     -void nilfs_clear_dirty_pages(struct address_space *, bool);
    -+void nilfs_clear_folio_dirty(struct folio *folio);
    ++void nilfs_clear_dirty_page(struct page *page);
     +void nilfs_clear_dirty_pages(struct address_space *mapping);
    + void nilfs_mapping_init(struct address_space *mapping, struct inode *inode);
      unsigned int nilfs_page_count_clean_buffers(struct page *, unsigned int,
      					    unsigned int);
    - unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.15.y       |  Success    |  Failed    |
| stable/linux-5.10.y       |  Success    |  Failed    |
| stable/linux-5.4.y        |  Success    |  Failed    |

Build Errors:
Build error for stable/linux-5.15.y:
    ssh: connect to host 192.168.1.58 port 22: No route to host

Build error for stable/linux-5.10.y:
    ssh: connect to host 192.168.1.58 port 22: No route to host

Build error for stable/linux-5.4.y:
    ssh: connect to host 192.168.1.58 port 22: No route to host

  reply	other threads:[~2025-02-07 22:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 14:23 [PATCH 5.4 5.10 5.15 0/3] nilfs2: protect busy buffer heads from being force-cleared Ryusuke Konishi
2025-02-07 14:23 ` [PATCH 5.4 5.10 5.15 1/3] nilfs2: do not output warnings when clearing dirty buffers Ryusuke Konishi
2025-02-07 22:51   ` Sasha Levin [this message]
2025-02-07 14:23 ` [PATCH 5.4 5.10 5.15 2/3] nilfs2: do not force clear folio if buffer is referenced Ryusuke Konishi
2025-02-07 14:23 ` [PATCH 5.4 5.10 5.15 3/3] nilfs2: protect access to buffers with no active references Ryusuke Konishi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250207164045-972882c161d33629@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=konishi.ryusuke@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.