* nilfs_cleanerd won't run on root @ 2009-11-05 17:41 Andrew Benton 0 siblings, 0 replies; 14+ messages in thread From: Andrew Benton @ 2009-11-05 17:41 UTC (permalink / raw) To: users-JrjvKiOkagjYtjvyW6yDsg Hello world, I've installed linux on a 10gb nilfs2 root partition /dev/sda2. When I boot into it nilfs_cleanerd won't run root:/home/andy# ps aux | grep nilfs_cleanerd root 1497 0.0 0.0 5456 592 pts/0 S+ 17:18 0:00 grep nilfs_cleanerd If I start nilfs_cleanerd with a command it quits with no error message at the command prompt but it leaves this in the system log Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: start Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: cannot open nilfs on (null): No such file or directory Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: cannot create cleanerd on (null): No such file or directory Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: shutdown If I pass it different options the only thing that changes is the error it dumps in the system log root:/home/andy# nilfs_cleanerd / Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: start Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: cannot open nilfs on /: Inappropriate ioctl for device Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: cannot create cleanerd on /: Inappropriate ioctl for device Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: shutdown root:/home/andy# nilfs_cleanerd /dev/sda2 Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: start Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: cannot open nilfs on /dev/sda2: No such file or directory Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: cannot create cleanerd on /dev/sda2: No such file or directory Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: shutdown root:/home/andy# cat /etc/mtab /dev/sda2 / nilfs2 rw,gcpid=1292 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 devpts /dev/pts devpts rw,gid=4,mode=620 0 0 shm /dev/shm tmpfs rw 0 0 /dev/sda1 /mnt/windows ntfs rw,umask=0 0 0 /dev/sda7 /home reiserfs rw 0 0 /dev/sda3 /mnt/lfs btrfs rw 0 0 The only way I can get garbage collection to run is if I reboot into a different partition and mount it from there. Andrew Benton ^ permalink raw reply [flat|nested] 14+ messages in thread
* nilfs_cleanerd shutdown
@ 2009-06-21 19:10 sh1v4_0h-/E1597aS9LQAvxtiuMwx3w
[not found] ` <280074.80083.qm-klR48C3JjEDrNpU5RS+xBlZ8N9CAUha/QQ4Iyu8u01E@public.gmane.org>
0 siblings, 1 reply; 14+ messages in thread
From: sh1v4_0h-/E1597aS9LQAvxtiuMwx3w @ 2009-06-21 19:10 UTC (permalink / raw)
To: users-JrjvKiOkagjYtjvyW6yDsg
When I mount nilfs filesystems, nilfs_cleanerd does something like this:
Jun 21 19:44:06 localhost mount.nilfs2: WARNING! - The NILFS on-disk format may change at any time.
Jun 21 19:44:06 localhost mount.nilfs2: WARNING! - Do not place critical data on a NILFS filesystem.
Jun 21 19:44:07 localhost nilfs_cleanerd[4120]: start
Jun 21 19:44:07 localhost nilfs_cleanerd[4120]: cannot create cleanerd on /dev/mapper/system-root
Jun 21 19:44:07 localhost nilfs_cleanerd[4120]: shutdown
but if I run 'nilfs_cleanerd' without any arguments as root everything works just fine and nilfs_cleanerd seems to find the mounted device automatically and frees space on it:
Jun 21 20:27:50 localhost nilfs_cleanerd[7704]: start
Is there someting I can do so nilfs_cleanerd will work with mount.nilfs2?
^ permalink raw reply [flat|nested] 14+ messages in thread[parent not found: <280074.80083.qm-klR48C3JjEDrNpU5RS+xBlZ8N9CAUha/QQ4Iyu8u01E@public.gmane.org>]
[parent not found: <20090622.030037.34127637.ryusuke-sG5X7nlA6pw@public.gmane.org>]
* Re: nilfs_cleanerd shutdown [not found] ` <20090622.030037.34127637.ryusuke-sG5X7nlA6pw@public.gmane.org> @ 2009-06-22 1:01 ` Jiro SEKIBA 2009-06-22 1:09 ` nilfs_cleanerd on root partition Jiro SEKIBA 1 sibling, 0 replies; 14+ messages in thread From: Jiro SEKIBA @ 2009-06-22 1:01 UTC (permalink / raw) To: NILFS Users mailing list Hi, At Sun, 21 Jun 2009 12:10:56 -0700 (PDT), sh1v4_0h-/E1597aS9LQAvxtiuMwx3w@public.gmane.org wrote: > When I mount nilfs filesystems, nilfs_cleanerd does something like this: > > Jun 21 19:44:06 localhost mount.nilfs2: WARNING! - The NILFS on-disk format may change at any time. > Jun 21 19:44:06 localhost mount.nilfs2: WARNING! - Do not place critical data on a NILFS filesystem. > Jun 21 19:44:07 localhost nilfs_cleanerd[4120]: start > Jun 21 19:44:07 localhost nilfs_cleanerd[4120]: cannot create cleanerd on /dev/mapper/system-root > Jun 21 19:44:07 localhost nilfs_cleanerd[4120]: shutdown > > but if I run 'nilfs_cleanerd' without any arguments as root everything works just fine and nilfs_cleanerd seems to find the mounted device automatically and frees space on it: > > Jun 21 20:27:50 localhost nilfs_cleanerd[7704]: start > > Is there someting I can do so nilfs_cleanerd will work with mount.nilfs2? I had same problem. The recent patch against nilfs-utils works find for me and cleanerd now automaticaly starats when mount the nilfs partition. It would be worth for you to apply it. > Message-Id: <20090622.030037.34127637.ryusuke-sG5X7nlA6pw@public.gmane.org> or just pull recent git repository. thanks regards, -- Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: nilfs_cleanerd on root partition [not found] ` <20090622.030037.34127637.ryusuke-sG5X7nlA6pw@public.gmane.org> 2009-06-22 1:01 ` Jiro SEKIBA @ 2009-06-22 1:09 ` Jiro SEKIBA 1 sibling, 0 replies; 14+ messages in thread From: Jiro SEKIBA @ 2009-06-22 1:09 UTC (permalink / raw) To: NILFS Users mailing list Hi, At Mon, 22 Jun 2009 03:00:37 +0900 (JST), Ryusuke Konishi wrote: > > On Mon, 22 Jun 2009 01:05:10 +0900 (JST), Ryusuke Konishi wrote: > > Hi, > > On Sun, 21 Jun 2009 17:37:08 +0300, Sami Liedes wrote: > > > On Sun, Jun 21, 2009 at 05:02:34PM +0300, Sami Liedes wrote: > > > > You say I should start the cleanerd by running > > > > > > > > # nilfs_cleanerd /dev/sdb1 / > > > > > > > > However nothing in the output of `nilfs_cleanerd -h' indicates > > > > anything of the second parameter (mount point). Looking at the source, > > > > that's how mount.nilfs2 runs it too, and that's exactly the case where > > > > it fails. > > > > > > OK, I debugged a bit and figured out what the real problem is. It's > > > the fact that nilfs_find_fs() is too strict about the mount points > > > being the same. Namely, it considers /media/lacie and /media/lacie/ to > > > be different mount points (it merely does a strcmp()). > > > > > > /proc/mounts always uses the former syntax, so if the mount command is > > > something like `mount /dev/mapper/lacie /media/lacie/ -t nilfs2', the > > > cleanerd is not started because mount passes "/media/lacie/" as the > > > mount point, and nilfs_find_fs() expects it to not have the last > > > slash. > > > > > > Sami > > > > Grr, that's an elementary and influential bug. Okay, I'll fix it. > > > > Sami, thank you for finding this! > > > > Cheers, > > Ryusuke Konishi > > The following patch will fix this. I've pushed it to the git repo, > too. > > Regards, > Ryusuke Konishi > --- > lib/nilfs.c | 29 +++++++++++++++++++++++++---- > 1 files changed, 25 insertions(+), 4 deletions(-) > > diff --git a/lib/nilfs.c b/lib/nilfs.c > index 15ee98f..9c80538 100644 > --- a/lib/nilfs.c > +++ b/lib/nilfs.c > @@ -147,14 +147,27 @@ static int nilfs_find_fs(struct nilfs *nilfs, const char *dev, const char *dir, > size_t len; > int ret, n; > char canonical[PATH_MAX + 2]; > + char *cdev = NULL, *cdir = NULL; > > - if (dev && myrealpath(dev, canonical, sizeof(canonical))) > - dev = canonical; > + ret = -1; > + if (dev && myrealpath(dev, canonical, sizeof(canonical))) { > + cdev = strdup(canonical); > + if (!cdev) > + goto failed; > + dev = cdev; > + } > + > + if (dir && myrealpath(dir, canonical, sizeof(canonical))) { > + cdir = strdup(canonical); > + if (!cdir) > + goto failed_dev; > + dir = cdir; > + } > > fp = fopen(PROCMOUNTS, "r"); > if (fp == NULL) > - return -1; > - ret = -1; > + goto failed_dir; > + > while (fgets(line, sizeof(line), fp) != NULL) { > n = tokenize(line, mntent, NMNTFLDS); > assert(n == NMNTFLDS); > @@ -181,6 +194,14 @@ static int nilfs_find_fs(struct nilfs *nilfs, const char *dev, const char *dir, > } > } > fclose(fp); > + > + failed_dir: > + free(cdir); > + > + failed_dev: > + free(cdev); > + > + failed: > return ret; > } > > -- > 1.6.2 I've just pull the git repository and it just works fine for me! thanks! regards, -- Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org> ^ permalink raw reply [flat|nested] 14+ messages in thread
* nilfs_cleanerd on root partition
@ 2009-06-20 21:19 James Erickson
[not found] ` <20090620211939.GA5937-SsamVeerapxB2jdCq39ADS3k8SM3+oTIrE5yTffgRl4@public.gmane.org>
0 siblings, 1 reply; 14+ messages in thread
From: James Erickson @ 2009-06-20 21:19 UTC (permalink / raw)
To: users-JrjvKiOkagjYtjvyW6yDsg
i am new to nilfs2 so i am sorry to ask such a simple question. how do i
get nilfs_cleanerd to run on my root partition? my disk is a 64 GB intel
ssd and it is completely full of checkpoints. my system is originally 4
GB in size. it is gentoo amd64 running linux-2.6.30-gentoo-r1. it has
nilfs2 support compiled in the kernel, not as a module. i thought that
nilfs_cleanerd would run when the root patition is mounted but i guess i
was wrong. i will gladly post any requested data. thank you for any help
you can offer in this matter.
^ permalink raw reply [flat|nested] 14+ messages in thread[parent not found: <20090620211939.GA5937-SsamVeerapxB2jdCq39ADS3k8SM3+oTIrE5yTffgRl4@public.gmane.org>]
* Re: nilfs_cleanerd on root partition [not found] ` <20090620211939.GA5937-SsamVeerapxB2jdCq39ADS3k8SM3+oTIrE5yTffgRl4@public.gmane.org> @ 2009-06-21 9:39 ` Ryusuke Konishi [not found] ` <20090621.183937.71761103.ryusuke-sG5X7nlA6pw@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: Ryusuke Konishi @ 2009-06-21 9:39 UTC (permalink / raw) To: users-JrjvKiOkagjYtjvyW6yDsg, psykojime-PkbjNfxxIARBDgjK7y7TUQ Hi, On Sat, 20 Jun 2009 16:19:39 -0500, James Erickson wrote: > i am new to nilfs2 so i am sorry to ask such a simple question. how > do i get nilfs_cleanerd to run on my root partition? my disk is a 64 > GB intel ssd and it is completely full of checkpoints. my system is > originally 4 GB in size. it is gentoo amd64 running > linux-2.6.30-gentoo-r1. it has nilfs2 support compiled in the > kernel, not as a module. i thought that nilfs_cleanerd would run > when the root patition is mounted but i guess i was wrong. i will > gladly post any requested data. thank you for any help you can offer > in this matter. nilfs_cleanerd is invoked when the partition is mounted, but sleeps if no reclaimable data exists. Is there nilfs_cleanerd process ? $ ps aux | grep nilfs_cleanerd If it exists, please try decreasing the protection period in /etc/nilfs_cleanerd.conf. Nilfs tries to preserve all past data within the period. $ sudo vi /etc/nilfs_cleanred.conf # Protection period in second - protection_period 3600 + protection_period 300 After changed the conf file, you must send a HUP signal to the cleaner daemon in order to reflect the change. $ mount -t nilfs2 /dev/sdb1 on / type nilfs2 (rw,gcpid=14126) $ sudo kill -HUP 14126 Then, it will start working to make free space. If the cleanerd did not exist, you can invoke it by hand. # nilfs_cleanerd /dev/sdb1 / In this case, you also have to shutdown it by hand. Cheers, Ryusuke Konishi ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <20090621.183937.71761103.ryusuke-sG5X7nlA6pw@public.gmane.org>]
* Re: nilfs_cleanerd on root partition [not found] ` <20090621.183937.71761103.ryusuke-sG5X7nlA6pw@public.gmane.org> @ 2009-06-21 13:44 ` Sami Liedes [not found] ` <20090621134418.GA4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: Sami Liedes @ 2009-06-21 13:44 UTC (permalink / raw) To: users-JrjvKiOkagjYtjvyW6yDsg [-- Attachment #1.1: Type: text/plain, Size: 1100 bytes --] On Sun, Jun 21, 2009 at 06:39:37PM +0900, Ryusuke Konishi wrote: > nilfs_cleanerd is invoked when the partition is mounted, but sleeps if > no reclaimable data exists. > > Is there nilfs_cleanerd process ? > > $ ps aux | grep nilfs_cleanerd [...] > If the cleanerd did not exist, you can invoke it by hand. > > # nilfs_cleanerd /dev/sdb1 / Hmm, for me, nilfs_cleanerd does not start with such a command (either from mount or by hand). I *think* I might know what the problem is. The nilfs2-tools in Debian unstable is 2.0.12, while the version of nilfs2 in 2.6.30 is .14 unless I'm mistaken. In any case I'd be very happy to get some error messages visible somewhere; mount failed silently to start nilfs_cleanerd, even starting nilfs_cleanerd by hand doesn't output anything to indicate it did not succeed, and there's nothing in dmesg about that either. The only indication there's something wrong, if you know to look, is the message "cannot create cleanerd on /dev/mapper/lacie" in /var/log/daemon.log and the fact that cleanerd is not running. Sami [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 835 bytes --] [-- Attachment #2: Type: text/plain, Size: 158 bytes --] _______________________________________________ users mailing list users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org https://www.nilfs.org/mailman/listinfo/users ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <20090621134418.GA4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org>]
* Re: nilfs_cleanerd on root partition [not found] ` <20090621134418.GA4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org> @ 2009-06-21 14:02 ` Sami Liedes [not found] ` <20090621140234.GB4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: Sami Liedes @ 2009-06-21 14:02 UTC (permalink / raw) To: users-JrjvKiOkagjYtjvyW6yDsg [-- Attachment #1.1: Type: text/plain, Size: 1603 bytes --] On Sun, Jun 21, 2009 at 04:44:19PM +0300, Sami Liedes wrote: > I *think* I might know what the problem is. The nilfs2-tools in Debian > unstable is 2.0.12, while the version of nilfs2 in 2.6.30 is .14 > unless I'm mistaken. Never mind, I just realized 2.0.12 is the latest -tools. You say I should start the cleanerd by running # nilfs_cleanerd /dev/sdb1 / However nothing in the output of `nilfs_cleanerd -h' indicates anything of the second parameter (mount point). Looking at the source, that's how mount.nilfs2 runs it too, and that's exactly the case where it fails. Running merely `nilfs_cleanerd /dev/mapper/lacie', as per the nilfs_cleanerd -h output, succeeds (but I don't know if it does the right thing). When I (or mount) gives the mount point as a second parameter, it fails fairly silently. I only get this in /var/log/daemon.log: When started by mount.nilfs2: ------------------------------------------------------------ Jun 20 20:34:28 lh nilfs_cleanerd[27527]: start Jun 20 20:34:28 lh nilfs_cleanerd[27527]: cannot create cleanerd on /dev/mapper/lacie Jun 20 20:34:28 lh nilfs_cleanerd[27527]: shutdown ------------------------------------------------------------ When started manually by running `nilfs_cleanerd /dev/mapper/lacie /media/lacie' (the mount point): ------------------------------------------------------------ Jun 21 16:12:04 lh nilfs_cleanerd[2573]: start Jun 21 16:12:04 lh nilfs_cleanerd[2573]: cannot create cleanerd on /dev/mapper/lacie Jun 21 16:12:04 lh nilfs_cleanerd[2573]: shutdown ------------------------------------------------------------ Sami [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 835 bytes --] [-- Attachment #2: Type: text/plain, Size: 158 bytes --] _______________________________________________ users mailing list users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org https://www.nilfs.org/mailman/listinfo/users ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <20090621140234.GB4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org>]
* Re: nilfs_cleanerd on root partition [not found] ` <20090621140234.GB4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org> @ 2009-06-21 14:37 ` Sami Liedes [not found] ` <20090621143708.GC4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: Sami Liedes @ 2009-06-21 14:37 UTC (permalink / raw) To: users-JrjvKiOkagjYtjvyW6yDsg [-- Attachment #1.1: Type: text/plain, Size: 944 bytes --] On Sun, Jun 21, 2009 at 05:02:34PM +0300, Sami Liedes wrote: > You say I should start the cleanerd by running > > # nilfs_cleanerd /dev/sdb1 / > > However nothing in the output of `nilfs_cleanerd -h' indicates > anything of the second parameter (mount point). Looking at the source, > that's how mount.nilfs2 runs it too, and that's exactly the case where > it fails. OK, I debugged a bit and figured out what the real problem is. It's the fact that nilfs_find_fs() is too strict about the mount points being the same. Namely, it considers /media/lacie and /media/lacie/ to be different mount points (it merely does a strcmp()). /proc/mounts always uses the former syntax, so if the mount command is something like `mount /dev/mapper/lacie /media/lacie/ -t nilfs2', the cleanerd is not started because mount passes "/media/lacie/" as the mount point, and nilfs_find_fs() expects it to not have the last slash. Sami [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 835 bytes --] [-- Attachment #2: Type: text/plain, Size: 158 bytes --] _______________________________________________ users mailing list users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org https://www.nilfs.org/mailman/listinfo/users ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <20090621143708.GC4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org>]
* Re: nilfs_cleanerd on root partition [not found] ` <20090621143708.GC4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org> @ 2009-06-21 16:05 ` Ryusuke Konishi [not found] ` <20090622.010510.133415216.ryusuke-sG5X7nlA6pw@public.gmane.org> 2009-11-06 5:41 ` nilfs_cleanerd won't run on root Jiro SEKIBA 1 sibling, 1 reply; 14+ messages in thread From: Ryusuke Konishi @ 2009-06-21 16:05 UTC (permalink / raw) To: users-JrjvKiOkagjYtjvyW6yDsg, sliedes-kf+aQKke1yb1KXRcyAk9cg Hi, On Sun, 21 Jun 2009 17:37:08 +0300, Sami Liedes wrote: > On Sun, Jun 21, 2009 at 05:02:34PM +0300, Sami Liedes wrote: > > You say I should start the cleanerd by running > > > > # nilfs_cleanerd /dev/sdb1 / > > > > However nothing in the output of `nilfs_cleanerd -h' indicates > > anything of the second parameter (mount point). Looking at the source, > > that's how mount.nilfs2 runs it too, and that's exactly the case where > > it fails. > > OK, I debugged a bit and figured out what the real problem is. It's > the fact that nilfs_find_fs() is too strict about the mount points > being the same. Namely, it considers /media/lacie and /media/lacie/ to > be different mount points (it merely does a strcmp()). > > /proc/mounts always uses the former syntax, so if the mount command is > something like `mount /dev/mapper/lacie /media/lacie/ -t nilfs2', the > cleanerd is not started because mount passes "/media/lacie/" as the > mount point, and nilfs_find_fs() expects it to not have the last > slash. > > Sami Grr, that's an elementary and influential bug. Okay, I'll fix it. Sami, thank you for finding this! Cheers, Ryusuke Konishi ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <20090622.010510.133415216.ryusuke-sG5X7nlA6pw@public.gmane.org>]
* Re: nilfs_cleanerd on root partition [not found] ` <20090622.010510.133415216.ryusuke-sG5X7nlA6pw@public.gmane.org> @ 2009-06-21 18:00 ` Ryusuke Konishi 0 siblings, 0 replies; 14+ messages in thread From: Ryusuke Konishi @ 2009-06-21 18:00 UTC (permalink / raw) To: users-JrjvKiOkagjYtjvyW6yDsg Cc: James Erickson, sliedes-kf+aQKke1yb1KXRcyAk9cg On Mon, 22 Jun 2009 01:05:10 +0900 (JST), Ryusuke Konishi wrote: > Hi, > On Sun, 21 Jun 2009 17:37:08 +0300, Sami Liedes wrote: > > On Sun, Jun 21, 2009 at 05:02:34PM +0300, Sami Liedes wrote: > > > You say I should start the cleanerd by running > > > > > > # nilfs_cleanerd /dev/sdb1 / > > > > > > However nothing in the output of `nilfs_cleanerd -h' indicates > > > anything of the second parameter (mount point). Looking at the source, > > > that's how mount.nilfs2 runs it too, and that's exactly the case where > > > it fails. > > > > OK, I debugged a bit and figured out what the real problem is. It's > > the fact that nilfs_find_fs() is too strict about the mount points > > being the same. Namely, it considers /media/lacie and /media/lacie/ to > > be different mount points (it merely does a strcmp()). > > > > /proc/mounts always uses the former syntax, so if the mount command is > > something like `mount /dev/mapper/lacie /media/lacie/ -t nilfs2', the > > cleanerd is not started because mount passes "/media/lacie/" as the > > mount point, and nilfs_find_fs() expects it to not have the last > > slash. > > > > Sami > > Grr, that's an elementary and influential bug. Okay, I'll fix it. > > Sami, thank you for finding this! > > Cheers, > Ryusuke Konishi The following patch will fix this. I've pushed it to the git repo, too. Regards, Ryusuke Konishi --- lib/nilfs.c | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/nilfs.c b/lib/nilfs.c index 15ee98f..9c80538 100644 --- a/lib/nilfs.c +++ b/lib/nilfs.c @@ -147,14 +147,27 @@ static int nilfs_find_fs(struct nilfs *nilfs, const char *dev, const char *dir, size_t len; int ret, n; char canonical[PATH_MAX + 2]; + char *cdev = NULL, *cdir = NULL; - if (dev && myrealpath(dev, canonical, sizeof(canonical))) - dev = canonical; + ret = -1; + if (dev && myrealpath(dev, canonical, sizeof(canonical))) { + cdev = strdup(canonical); + if (!cdev) + goto failed; + dev = cdev; + } + + if (dir && myrealpath(dir, canonical, sizeof(canonical))) { + cdir = strdup(canonical); + if (!cdir) + goto failed_dev; + dir = cdir; + } fp = fopen(PROCMOUNTS, "r"); if (fp == NULL) - return -1; - ret = -1; + goto failed_dir; + while (fgets(line, sizeof(line), fp) != NULL) { n = tokenize(line, mntent, NMNTFLDS); assert(n == NMNTFLDS); @@ -181,6 +194,14 @@ static int nilfs_find_fs(struct nilfs *nilfs, const char *dev, const char *dir, } } fclose(fp); + + failed_dir: + free(cdir); + + failed_dev: + free(cdev); + + failed: return ret; } -- 1.6.2 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: nilfs_cleanerd won't run on root [not found] ` <20090621143708.GC4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org> 2009-06-21 16:05 ` Ryusuke Konishi @ 2009-11-06 5:41 ` Jiro SEKIBA [not found] ` <87639oqkfb.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org> 1 sibling, 1 reply; 14+ messages in thread From: Jiro SEKIBA @ 2009-11-06 5:41 UTC (permalink / raw) To: NILFS Users mailing list Hi, Andrew Which distribution are you using? What version of kernel and nilfs module are in the distro? How is your /proc/mounts like? It looks like you are using a bit older version. Older version of nilfs2-utils had the similar problem, but latest version would not have the issue. regards, -- Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org> At Thu, 05 Nov 2009 17:41:00 +0000, Andrew Benton wrote: > > Hello world, > I've installed linux on a 10gb nilfs2 root partition /dev/sda2. When I > boot into it nilfs_cleanerd won't run > > root:/home/andy# ps aux | grep nilfs_cleanerd > root 1497 0.0 0.0 5456 592 pts/0 S+ 17:18 0:00 grep nilfs_cleanerd > > If I start nilfs_cleanerd with a command it quits with no error message > at the command prompt but it leaves this in the system log > > Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: start > Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: cannot open nilfs on (null): No such file or directory > Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: cannot create cleanerd on (null): No such file or directory > Nov 5 17:18:05 eccles nilfs_cleanerd[1495]: shutdown > > If I pass it different options the only thing that changes is the error it dumps in the system log > > root:/home/andy# nilfs_cleanerd / > > Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: start > Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: cannot open nilfs on /: Inappropriate ioctl for device > Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: cannot create cleanerd on /: Inappropriate ioctl for device > Nov 5 17:19:02 eccles nilfs_cleanerd[1503]: shutdown > > root:/home/andy# nilfs_cleanerd /dev/sda2 > > Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: start > Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: cannot open nilfs on /dev/sda2: No such file or directory > Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: cannot create cleanerd on /dev/sda2: No such file or directory > Nov 5 17:19:26 eccles nilfs_cleanerd[1505]: shutdown > > root:/home/andy# cat /etc/mtab > /dev/sda2 / nilfs2 rw,gcpid=1292 0 0 > proc /proc proc rw 0 0 > sysfs /sys sysfs rw 0 0 > devpts /dev/pts devpts rw,gid=4,mode=620 0 0 > shm /dev/shm tmpfs rw 0 0 > /dev/sda1 /mnt/windows ntfs rw,umask=0 0 0 > /dev/sda7 /home reiserfs rw 0 0 > /dev/sda3 /mnt/lfs btrfs rw 0 0 > > The only way I can get garbage collection to run is if I reboot into > a different partition and mount it from there. > > Andrew Benton > _______________________________________________ > users mailing list > users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org > https://www.nilfs.org/mailman/listinfo/users > > > ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <87639oqkfb.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org>]
* Re: nilfs_cleanerd won't run on root [not found] ` <87639oqkfb.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org> @ 2009-11-06 11:43 ` Andrew Benton 2009-11-06 12:17 ` Andrew Benton 1 sibling, 0 replies; 14+ messages in thread From: Andrew Benton @ 2009-11-06 11:43 UTC (permalink / raw) To: NILFS Users mailing list On 06/11/09 05:41, Jiro SEKIBA wrote: > Hi, Andrew > > Which distribution are you using? > What version of kernel and nilfs module are in the distro? > How is your /proc/mounts like? > > It looks like you are using a bit older version. > Older version of nilfs2-utils had the similar problem, > but latest version would not have the issue. > I'm using nilfs-utils-2.0.14. The kernel is a vanilla 2.6.31.4 self compiled with no modules (everything compiled in). The system is self compiled (based on Linux From Scratch). /proc/mounts is a symbolic link pointing at /proc/self/mounts. /proc/self is a symbolic link pointing at /proc/1511 so /proc/mounts is actually pointing at /proc/1511/mounts andy:~$ cat /proc/mounts rootfs / rootfs rw 0 0 /dev/root / nilfs2 rw,relatime 0 0 proc /proc proc rw,relatime 0 0 sysfs /sys sysfs rw,relatime 0 0 tmpfs /dev tmpfs rw,relatime,mode=755 0 0 devpts /dev/pts devpts rw,relatime,gid=4,mode=620 0 0 shm /dev/shm tmpfs rw,relatime 0 0 /dev/sda1 /mnt/windows ntfs ro,relatime,uid=0,gid=0,umask=00,nls=default,errors=continue,mft_zone_multiplier=1 0 0 /dev/sda7 /home reiserfs rw,relatime 0 0 /dev/sda3 /mnt/lfs btrfs rw,relatime 0 0 andy:~$ ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: nilfs_cleanerd won't run on root [not found] ` <87639oqkfb.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org> 2009-11-06 11:43 ` Andrew Benton @ 2009-11-06 12:17 ` Andrew Benton 1 sibling, 0 replies; 14+ messages in thread From: Andrew Benton @ 2009-11-06 12:17 UTC (permalink / raw) To: NILFS Users mailing list On 06/11/09 05:41, Jiro SEKIBA wrote: > How is your /proc/mounts like? Thanks for your help, that pointed me in the right direction. /proc/mounts shows the root filesystem as /dev/root, which doesn't exist. If I make a symbolic link /dev/root pointing at /dev/sda2 then I can start nilfs_cleanerd. Now I just need to craft a udev rule to make that symbolic link and start nilfs_cleanerd. Andy ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2009-11-06 12:17 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-05 17:41 nilfs_cleanerd won't run on root Andrew Benton
-- strict thread matches above, loose matches on Subject: below --
2009-06-21 19:10 nilfs_cleanerd shutdown sh1v4_0h-/E1597aS9LQAvxtiuMwx3w
[not found] ` <280074.80083.qm-klR48C3JjEDrNpU5RS+xBlZ8N9CAUha/QQ4Iyu8u01E@public.gmane.org>
[not found] ` <20090622.030037.34127637.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-06-22 1:01 ` Jiro SEKIBA
2009-06-22 1:09 ` nilfs_cleanerd on root partition Jiro SEKIBA
2009-06-20 21:19 James Erickson
[not found] ` <20090620211939.GA5937-SsamVeerapxB2jdCq39ADS3k8SM3+oTIrE5yTffgRl4@public.gmane.org>
2009-06-21 9:39 ` Ryusuke Konishi
[not found] ` <20090621.183937.71761103.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-06-21 13:44 ` Sami Liedes
[not found] ` <20090621134418.GA4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org>
2009-06-21 14:02 ` Sami Liedes
[not found] ` <20090621140234.GB4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org>
2009-06-21 14:37 ` Sami Liedes
[not found] ` <20090621143708.GC4836-7bsdmvTMBDzHOG6cAo2yLw@public.gmane.org>
2009-06-21 16:05 ` Ryusuke Konishi
[not found] ` <20090622.010510.133415216.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-06-21 18:00 ` Ryusuke Konishi
2009-11-06 5:41 ` nilfs_cleanerd won't run on root Jiro SEKIBA
[not found] ` <87639oqkfb.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org>
2009-11-06 11:43 ` Andrew Benton
2009-11-06 12:17 ` Andrew Benton
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox