linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug with "fix partial page writes"
@ 2011-11-08 22:59 Curt Wohlgemuth
  2011-11-20 20:59 ` Hugh Dickins
  0 siblings, 1 reply; 32+ messages in thread
From: Curt Wohlgemuth @ 2011-11-08 22:59 UTC (permalink / raw)
  To: Allison Henderson, ext4 development; +Cc: Hugh Dickins

It appears that there's a bug with this patch:

-------------------------------------------
commit 02fac1297eb3f471a27368271aadd285548297b0
Author: Allison Henderson <achender@linux.vnet.ibm.com>
Date:   Tue Sep 6 21:53:01 2011 -0400

    ext4: fix partial page writes
...
-------------------------------------------

Hugh Dickens found a bug with some nasty testing and lockdep that
crashed in ext4_da_write_end(), and after looking at the code with
him, it appears that the call to
ext4_discard_partial_page_buffers_no_lock() in this routine is
manipulating an unlocked, and possibly non-existent page:


-------------------------------------------
...
	ret2 = generic_write_end(file, mapping, pos, len, copied,
							page, fsdata);

	page_len = PAGE_CACHE_SIZE -
			((pos + copied - 1) & (PAGE_CACHE_SIZE - 1));

	if (page_len > 0) {
		ret = ext4_discard_partial_page_buffers_no_lock(handle,
			inode, page, pos + copied - 1, page_len,
			EXT4_DISCARD_PARTIAL_PG_ZERO_UNMAPPED);
	}
...
-------------------------------------------

Note that generic_write_end() will unlock and release the page before
it returns.

I've no good answer for how to fix this properly, but I wanted to let
Allison know about this, if she hadn't already.  I looked but didn't
see any related email on the linux-ext4 list for this problem.

Thanks,
Curt

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2011-12-14 18:07 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 22:59 Bug with "fix partial page writes" Curt Wohlgemuth
2011-11-20 20:59 ` Hugh Dickins
2011-11-21  1:59   ` Yongqiang Yang
2011-11-21 17:38     ` Allison Henderson
     [not found]       ` <CAMBkX3cfQ+XS7M5jvXmj8_rBOJ_Afy+YXL7Roj+fswLqBA7i1Q@mail.gmail.com>
2011-11-21 21:26         ` Fwd: " Surbhi Palande
2011-11-22 15:57           ` Allison Henderson
2011-11-22  1:44       ` Yongqiang Yang
2011-11-21 16:56   ` Ted Ts'o
2011-11-21 22:04     ` Hugh Dickins
2011-12-05 23:38       ` Bug with "fix partial page writes" [3.2-rc regression] Hugh Dickins
2011-12-06  1:40         ` Allison Henderson
2011-12-06  3:08           ` Yongqiang Yang
2011-12-06  3:20             ` Yongqiang Yang
2011-12-06  3:33             ` Tao Ma
2011-12-06  3:44               ` Yongqiang Yang
2011-12-06  4:05                 ` Allison Henderson
2011-12-06  7:57                   ` Yongqiang Yang
2011-12-06  8:55           ` Hugh Dickins
2011-12-06  9:32             ` Yongqiang Yang
2011-12-06 22:31               ` Hugh Dickins
2011-12-06 21:15             ` Allison Henderson
2011-12-06 22:47               ` Hugh Dickins
2011-12-07  8:28               ` Yongqiang Yang
2011-12-07 17:04                 ` Allison Henderson
2011-12-08  5:10                   ` Allison Henderson
2011-12-08 17:39                     ` Hugh Dickins
2011-12-08 18:12                       ` Andy Whitcroft
2011-12-09 13:33                         ` Andy Whitcroft
2011-12-09 13:44                           ` Yongqiang Yang
2011-12-09 16:37                             ` Allison Henderson
2011-12-14  4:12                       ` Ted Ts'o
2011-12-14 18:07                         ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).