Skip to contentSkip to conversation

cleanerd stopping

DISCUSSION John Huttley 2 participants 5 messages Nov 8, 2008 – Dec 18, 2008 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,
I've found that the cleaner will only run for a day or so, then it stops.

The log is as follows.

2008-11-07T22:02:22+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:22+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:22+13:00 nilfs_cleanerd[7232]: 2 segments selected to 
be cleaned
2008-11-07T22:02:24+13:00 nilfs_cleanerd[7232]: segment 30 cleaned
2008-11-07T22:02:24+13:00 nilfs_cleanerd[7232]: segment 31 cleaned
2008-11-07T22:02:24+13:00 nilfs_cleanerd[7232]: wait 3.719660000
2008-11-07T22:02:27+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:27+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:27+13:00 nilfs_cleanerd[7232]: 2 segments selected to 
be cleaned
2008-11-07T22:02:29+13:00 nilfs_cleanerd[7232]: segment 32 cleaned
2008-11-07T22:02:29+13:00 nilfs_cleanerd[7232]: segment 33 cleaned
2008-11-07T22:02:29+13:00 nilfs_cleanerd[7232]: wait 3.674263000
2008-11-07T22:02:32+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:32+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:32+13:00 nilfs_cleanerd[7232]: 2 segments selected to 
be cleaned
2008-11-07T22:02:34+13:00 nilfs_cleanerd[7232]: segment 34 cleaned
2008-11-07T22:02:34+13:00 nilfs_cleanerd[7232]: segment 35 cleaned
2008-11-07T22:02:34+13:00 nilfs_cleanerd[7232]: wait 3.497175000
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: 2 segments selected to 
be cleaned
2008-11-07T22:02:39+13:00 nilfs_cleanerd[7232]: cannot clean segments: 
No such file or directory
2008-11-07T22:02:39+13:00 nilfs_cleanerd[7232]: shutdown

Regards,

John

#2 lore raw
In reply to a message not in the archive

Hi John,

Quoted 9 lines · John Huttley

Hi,
I've found that the cleaner will only run for a day or so, then it stops.

The log is as follows.

2008-11-07T22:02:22+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:22+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:22+13:00 nilfs_cleanerd[7232]: 2 segments selected to 

be cleaned

<snip>

Quoted 7 lines
2008-11-07T22:02:34+13:00 nilfs_cleanerd[7232]: wait 3.497175000
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: 2 segments selected to 
be cleaned
2008-11-07T22:02:39+13:00 nilfs_cleanerd[7232]: cannot clean segments: 

No such file or directory

Did you see any kernel messages on system logs (i.e. /var/log/syslog or /var/log/messages)?

The cleanerd typically outputs this message when it received a kernel internal error code ENOENT from the nilfs2 module.

If you didn't see any related kernel messages on the logs, I have to write a patch to identify the causal function and ask you to test it; there are several paths that may return this error code.

At the moment, I'm guessing that some kind of meta data information (e.g. DAT) is broken due to the previous version of cleanerd.

With regards,
Ryusuke Konishi

#3 lore raw
In reply to a message not in the archive
Quoted 4 lines · John Huttley

Hi,
I've found that the cleaner will only run for a day or so, then it stops.

The log is as follows.

<snip>

Quoted 7 lines
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: 2 segments selected to 
be cleaned
2008-11-07T22:02:39+13:00 nilfs_cleanerd[7232]: cannot clean segments: 
No such file or directory
2008-11-07T22:02:39+13:00 nilfs_cleanerd[7232]: shutdown

I've found a bug of nilfs2 kernel module (in ioctl code) that may cause this error.

If the bug was the cause, it should occur for volumes having numerous snapshots, or on the machine whose amount of memory is low.

I would like to fix this early.

Regards,
Ryusuke

#5 lore raw
In reply to a message not in the archive

Hi Ryusuke,

The machine is has 1Gb ram 5110 processor in 64 bit mode nilfs is in a 4Gb partition. It is my IMAP spool.
The only time snapshots are taken is for backup, this is daily.

Traffic is low on the fs and the snapshot is deleted after the backup.

--john

Quoted 19 lines · Ryusuke Konishi
Quoted 5 lines · John Huttley

Hi,
I've found that the cleaner will only run for a day or so, then it stops.

The log is as follows.

<snip>

Quoted 6 lines
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: wake up
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: ncleansegs = 285
2008-11-07T22:02:37+13:00 nilfs_cleanerd[7232]: 2 segments selected to be cleaned
2008-11-07T22:02:39+13:00 nilfs_cleanerd[7232]: cannot clean segments: No such file or directory
2008-11-07T22:02:39+13:00 nilfs_cleanerd[7232]: shutdown

I've found a bug of nilfs2 kernel module (in ioctl code) that may cause this error.

Quoted 10 lines

If the bug was the cause, it should occur for volumes having numerous snapshots, or on the machine whose amount of memory is low.

I would like to fix this early.

Regards,
Ryusuke

_______________________________________________
users mailing list
[email protected]
https://www.nilfs.org/mailman/listinfo/users

#7 lore raw
In reply to a message not in the archive

Hi,

Quoted 7 lines · John Huttley
Quoted 6 lines · Ryusuke Konishi

I've found a bug of nilfs2 kernel module (in ioctl code) that may cause this error.

If the bug was the cause, it should occur for volumes having numerous snapshots, or on the machine whose amount of memory is low.

Quoted 7 lines
Quoted 1 line

I would like to fix this early.

The machine is has 1Gb ram 5110 processor in 64 bit mode nilfs is in a 4Gb partition. It is my IMAP spool.
The only time snapshots are taken is for backup, this is daily.

Traffic is low on the fs and the snapshot is deleted after the backup.

All right. This seems like another problem.

Anyhow, I made a patch to fix the other "no such file or directory" problem of the cleaner daemon. It's against nilfs-2.0.5.

Try the attached patch when in the mood.
I'll include it in the next nilfs release.

Thanks,
Ryusuke

---

fs/cpfile.c +14 -10
index 480dd31..1e9ce4c 100644
@@ -422,20 +422,20 @@ static ssize_t nilfs_cpfile_do_get_cpinfo(struct inode *cpfile, __u64 cno,
 	return ret;
 }
 
-static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 cno,
+static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 *cnop,
 					  struct nilfs_cpinfo *ci, size_t nci)
 {
 	struct buffer_head *bh;
 	struct nilfs_cpfile_header *header;
 	struct nilfs_checkpoint *cp;
-	__u64 curr, next;
+	__u64 curr = *cnop, next;
 	unsigned long curr_blkoff, next_blkoff;
 	void *kaddr;
 	int n, ret;
 
 	down_read(&NILFS_MDT(cpfile)->mi_sem);
 
-	if (cno == 0) {
+	if (curr == 0) {
 		ret = nilfs_cpfile_get_header_block(cpfile, &bh);
 		if (ret < 0)
 			goto out;
@@ -448,8 +448,11 @@ static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 cno,
 			ret = 0;
 			goto out;
 		}
-	} else
-		curr = cno;
+	} else if (unlikely(curr == ~(__u64)0)) {
+		ret = 0;
+		goto out;
+	}
+
 	curr_blkoff = nilfs_cpfile_get_blkoff(cpfile, curr);
 	ret = nilfs_cpfile_get_checkpoint_block(cpfile, curr, 0, &bh);
 	if (ret < 0)
@@ -461,7 +464,7 @@ static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 cno,
 		nilfs_cpfile_checkpoint_to_cpinfo(cpfile, cp, &ci[n]);
 		next = le64_to_cpu(cp->cp_snapshot_list.ssl_next);
 		if (next == 0) {
-			curr = next;
+			curr = ~(__u64)0; /* Terminator */
 			n++;
 			break;
 		}
@@ -480,6 +483,7 @@ static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 cno,
 	}
 	kunmap_atomic(kaddr, KM_USER0);
 	brelse(bh);
+	*cnop = curr;
 	ret = n;
 
  out:
@@ -494,15 +498,15 @@ static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 cno,
  * @ci:
  * @nci:
  */
-ssize_t nilfs_cpfile_get_cpinfo(struct inode *cpfile,
-				__u64 cno, int mode,
+
+ssize_t nilfs_cpfile_get_cpinfo(struct inode *cpfile, __u64 *cnop, int mode,
 				struct nilfs_cpinfo *ci, size_t nci)
 {
 	switch (mode) {
 	case NILFS_CHECKPOINT:
-		return nilfs_cpfile_do_get_cpinfo(cpfile, cno, ci, nci);
+		return nilfs_cpfile_do_get_cpinfo(cpfile, *cnop, ci, nci);
 	case NILFS_SNAPSHOT:
-		return nilfs_cpfile_do_get_ssinfo(cpfile, cno, ci, nci);
+		return nilfs_cpfile_do_get_ssinfo(cpfile, cnop, ci, nci);
 	default:
 		return -EINVAL;
 	}
fs/cpfile.h +1 -1
index 8bebcf1..02917e4 100644
@@ -39,7 +39,7 @@ int nilfs_cpfile_delete_checkpoint(struct inode *, __u64);
 int nilfs_cpfile_change_cpmode(struct inode *, __u64, int);
 int nilfs_cpfile_is_snapshot(struct inode *, __u64);
 int nilfs_cpfile_get_stat(struct inode *, struct nilfs_cpstat *);
-ssize_t nilfs_cpfile_get_cpinfo(struct inode *, __u64, int,
+ssize_t nilfs_cpfile_get_cpinfo(struct inode *, __u64 *, int,
 				struct nilfs_cpinfo *, size_t);
 
 #endif	/* _NILFS_CPFILE_H */
fs/ioctl.c +30 -33

159 lines not on this page · raw message