On Mon, 2008-04-28 at 20:09 +0200, Jan Kara wrote:Thanks, yes I noticed that after you pointing this out. But __journal_try_to_free_buffer() only unfile the buffer from t_sync_datalist or t_locked list, the journal head is not removed in journal_remove_journal_head() there, at that time, journal_remove_journal_head() just check if counter b_jcount is 0. But before calling __journal_try_to_free_buffer(), since journal_try_to_free_buffers() already increase the b_jcount in journal_grab_journal_head(), so the journal head is not removed in __journal_try_to_free_buffer-> journal_remove_journal_head() Looking at the code, it seems the it's the journal_put_journal_head(jh) who remove the journal head and decrease the bh journal_try_to_free_buffers() { ... jh = journal_grab_journal_head(bh); if (!jh) continue; jbd_lock_bh_state(bh); __journal_try_to_free_buffer(journal, bh); journal_put_journal_head(jh); jbd_unlock_bh_state(bh); ... } so when journal_put_journal_head()-> __journal_remove_journal_head(), now the b_jcount is zero, but is jh->b_transaction is NULL? So it seems possible that bh ref count is non zero when exit from journal_put_journal_head() if jh_b_transaction is not cleared. I miss where jh->b_transaction is clear to NULL? void journal_put_journal_head(struct journal_head *jh) { struct buffer_head *bh = jh2bh(jh); jbd_lock_bh_journal_head(bh); J_ASSERT_JH(jh, jh->b_jcount > 0); --jh->b_jcount; if (!jh->b_jcount && !jh->b_transaction) { __journal_remove_journal_head(bh); __brelse(bh); } jbd_unlock_bh_journal_head(bh); } Mingming --
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Linus Torvalds | Linux 2.6.27 |
| Eric Paris | [RFC 0/5] [TALPA] Intro to a linux interface for on access scanning |
git: | |
| Denis Bueno | Recovering from repository corruption |
| Linus Torvalds | I'm a total push-over.. |
| J. Bruce Fields | "failed to read delta base object at..." |
| Robin Rosenberg | Re: [wishlist] graphical diff |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Richard Stallman | Real men don't attack straw men |
| Marcos Laufer | dmesg IBM x3650 OpenBSD 4.3 |
| Paolo Supino | order |
| Simon Horman | Possible regression in HTB |
| Corey Hickey | SFQ: backport some features from ESFQ (try 4) |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Ingo Molnar | Re: [crash] kernel BUG at net/core/dev.c:1328! |
| Problem in Inserting a module | 50 minutes ago | Linux kernel |
| usb mic not detected | 1 hour ago | Applications and Utilities |
| Treason Uncloaked | 6 hours ago | Linux kernel |
| Shared swap partition | 17 hours ago | Linux general |
| high memory | 2 days ago | Linux kernel |
| semaphore access speed | 2 days ago | Applications and Utilities |
| the kernel how to power off the machine | 2 days ago | Linux kernel |
| Easter Eggs in windows XP | 2 days ago | Windows |
| Root password | 2 days ago | Linux general |
| Where/when DNOTIFY is used? | 2 days ago | Linux kernel |
