All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: nilfs_cpfile_delete_checkpoints: cannot delete block
@ 2009-05-05 15:26 admin-/LHdS3kC8BfYtjvyW6yDsg
       [not found] ` <D6LvKjCkn1gF.D60GTY3Z-GG6YVgmNXeLOQU1ULcgDhA@public.gmane.org>
  0 siblings, 1 reply; 20+ messages in thread
From: admin-/LHdS3kC8BfYtjvyW6yDsg @ 2009-05-05 15:26 UTC (permalink / raw)
  To: Ryusuke Konishi; +Cc: users-JrjvKiOkagjYtjvyW6yDsg

Thank you.
I will try this patch in a few hours.
If I see it correctly the patch will prevent this error in future and will not correct the current error, so I suppose that after applying the patch I will need to reformat the volume.

Bye,
David Arendt

-original message-
Subject: Re: [NILFS users] nilfs_cpfile_delete_checkpoints: cannot delete block
From: Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
Date: 05/05/2009 13:24

Hi David,
On Mon, 04 May 2009 06:16:24 +0200, David Arendt wrote:
> Hi,
> 
> This night. I had lots of:
> 
> nilfs_btree_propagate: key = 67, level == 0
> 
> On the parition where cleanerd has failed.

This error is related to the GC failure.

Both logs indicate that btree look-up of the 67th block on the
checkpoint file failed.

I suspect inconsistency between the block on page cache and btree; the
block was removed from the btree but were remaining on the page cache.

Could you try the following bugfix patch?

The patch ensures to clear dirty state of page and buffer after
removal of block, and would prevent the inconsistency.

Thanks in advance,
Ryusuke Konishi
--
diff --git a/fs/btnode.c b/fs/btnode.c
index 5e83c60..11a7305 100644
--- a/fs/btnode.c
+++ b/fs/btnode.c
@@ -176,7 +176,6 @@ void nilfs_btnode_delete(struct buffer_head *bh)
 	struct address_space *mapping;
 	struct page *page = bh->b_page;
 	pgoff_t index = page_index(page);
-	int still_dirty;
 
 	page_cache_get(page);
 	lock_page(page);
@@ -186,12 +185,11 @@ void nilfs_btnode_delete(struct buffer_head *bh)
 		BH_DEBUG(bh, "deleting unused btnode buffer");
 
 	nilfs_forget_buffer(bh);
-	still_dirty = PageDirty(page);
 	mapping = page->mapping;
 	unlock_page(page);
 	page_cache_release(page);
 
-	if (!still_dirty && mapping)
+	if (mapping)
 		invalidate_inode_pages2_range(mapping, index, index);
 }
 
diff --git a/fs/mdt.c b/fs/mdt.c
index 2792e76..4c9fb00 100644
--- a/fs/mdt.c
+++ b/fs/mdt.c
@@ -327,7 +327,7 @@ int nilfs_mdt_delete_block(struct inode *inode, unsigned long block)
 
 	mdt_debug(3, "called (ino=%lu, blkoff=%lu)\n", inode->i_ino, block);
 	err = nilfs_bmap_delete(ii->i_bmap, block);
-	if (likely(!err)) {
+	if (!err || err == -ENOENT) {
 		nilfs_mdt_mark_dirty(inode);
 		nilfs_mdt_forget_block(inode, block);
 	}
@@ -357,7 +357,6 @@ int nilfs_mdt_forget_block(struct inode *inode, unsigned long block)
 	struct page *page;
 	unsigned long first_block;
 	int ret = 0;
-	int still_dirty;
 
 	mdt_debug(3, "called (ino=%lu, blkoff=%lu)\n", inode->i_ino, block);
 	page = find_lock_page(inode->i_mapping, index);
@@ -373,13 +372,13 @@ int nilfs_mdt_forget_block(struct inode *inode, unsigned long block)
 
 		bh = nilfs_page_get_nth_block(page, block - first_block);
 		nilfs_forget_buffer(bh);
+	} else {
+		__nilfs_clear_page_dirty(page);
 	}
-	still_dirty = PageDirty(page);
 	unlock_page(page);
 	page_cache_release(page);
 
-	if (still_dirty ||
-	    invalidate_inode_pages2_range(inode->i_mapping, index, index) != 0)
+	if (invalidate_inode_pages2_range(inode->i_mapping, index, index) != 0)
 		ret = -EBUSY;
 	mdt_debug(3, "done (err=%d)\n", ret);
 	return ret;
diff --git a/fs/page.c b/fs/page.c
index 9cf93c3..d333fef 100644
--- a/fs/page.c
+++ b/fs/page.c
@@ -129,7 +129,8 @@ void nilfs_forget_buffer(struct buffer_head *bh)
 
 	lock_buffer(bh);
 	clear_buffer_nilfs_volatile(bh);
-	if (test_clear_buffer_dirty(bh) && nilfs_page_buffers_clean(page))
+	clear_buffer_dirty(bh);
+	if (nilfs_page_buffers_clean(page))
 		__nilfs_clear_page_dirty(page);
 
 	clear_buffer_uptodate(bh);

^ permalink raw reply related	[flat|nested] 20+ messages in thread
* nilfs_cpfile_delete_checkpoints: cannot delete block
@ 2009-05-02 22:55 David Arendt
       [not found] ` <49FCCF6F.3040101-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
  0 siblings, 1 reply; 20+ messages in thread
From: David Arendt @ 2009-05-02 22:55 UTC (permalink / raw)
  To: NILFS Users mailing list

Hi,

Until now nilfs-2.0.12 has run very stable without data corruption.
However on one partition (600G) I have got the following errors while 
running the cleaner:

nilfs_cpfile_delete_checkpoints: cannot delete block
NILFS: GC failed during preparation: cannot delete checkpoints: err=-2

This is a partition mainly holding large temporary render files (can be 
up to 25gb/file). There are currently 132702 snapshots.

As this partition is not used during the next few days, I will leave it 
with the error so if you would like me to test further things, please 
let me know.

Bye,
David Arendt

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

end of thread, other threads:[~2009-05-11  0:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 15:26 nilfs_cpfile_delete_checkpoints: cannot delete block admin-/LHdS3kC8BfYtjvyW6yDsg
     [not found] ` <D6LvKjCkn1gF.D60GTY3Z-GG6YVgmNXeLOQU1ULcgDhA@public.gmane.org>
2009-05-05 15:46   ` Ryusuke Konishi
     [not found]     ` <20090506.004648.105122016.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-05-05 16:51       ` David Arendt
     [not found]         ` <4A006EAB.6000206-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-05 19:32           ` David Arendt
     [not found]             ` <4A00944B.2020105-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-05 21:19               ` David Arendt
2009-05-06  3:02               ` Ryusuke Konishi
     [not found]                 ` <20090506.120204.27533580.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-05-06 15:46                   ` David Arendt
     [not found]                     ` <4A01B0D2.6030509-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-10  5:43                       ` Ryusuke Konishi
     [not found]                         ` <20090510.144313.10164669.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-05-10 13:04                           ` David Arendt
     [not found]                             ` <4A06D0C4.5030008-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-10 15:40                               ` Ryusuke Konishi
     [not found]                                 ` <20090511.004002.32775441.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-05-10 16:12                                   ` David Arendt
     [not found]                                     ` <4A06FCEB.7030800-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-11  0:57                                       ` Ryusuke Konishi
2009-05-10  9:10                   ` Ryusuke Konishi
  -- strict thread matches above, loose matches on Subject: below --
2009-05-02 22:55 David Arendt
     [not found] ` <49FCCF6F.3040101-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-03  8:08   ` Ryusuke Konishi
     [not found]     ` <20090503.170847.69363313.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-05-03  9:26       ` David Arendt
     [not found]         ` <49FD6359.1020405-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-03  9:44           ` Ryusuke Konishi
     [not found]             ` <20090503.184449.53062216.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-05-03 10:06               ` David Arendt
2009-05-04  4:16       ` David Arendt
     [not found]         ` <49FE6C18.3050707-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2009-05-05 11:23           ` Ryusuke Konishi

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.