Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Alexander Belyakov
On Sun, Feb 24, 2008 at 2:57 AM, Pavel Machek <[EMAIL PROTECTED]> wrote: > Hi! > > I'm trying to free space by truncating big file, and I get: > > [EMAIL PROTECTED]:~# ls -al gps.nmea > -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea > [EMAIL PROTECTED]:~# > gps.nmea > -sh:

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Pavel Machek
On Sun 2008-02-24 18:57:32, David Woodhouse wrote: > > On Sun, 2008-02-24 at 07:57 +0100, Jörn Engel wrote: > > Could a na??ve implementation of this get exploited by doing a large > > number of truncates that just shave single bytes off various files? > > Yeah, which is why _my_ na??ve

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Jamie Lokier
Pavel Machek wrote: > > You need to write a log entry indicating the new length of the file. > > There is no space for new log entries. > > > > There is a special case for removal -- 'rm gps.nmea' would work. Perhaps > > we should add a special case for truncation too, so that it can also use > >

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Jörn Engel
On Sun, 24 February 2008 18:57:32 +0800, David Woodhouse wrote: > On Sun, 2008-02-24 at 07:57 +0100, Jörn Engel wrote: > > Could a naïve implementation of this get exploited by doing a large > > number of truncates that just shave single bytes off various files? > > Yeah, which is why _my_ naïve

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread David Woodhouse
On Sun, 2008-02-24 at 07:57 +0100, Jörn Engel wrote: > Could a naïve implementation of this get exploited by doing a large > number of truncates that just shave single bytes off various files? Yeah, which is why _my_ naïve implementation would do it for truncate-to-zero instead of just _any_

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread David Woodhouse
On Sun, 2008-02-24 at 07:57 +0100, Jörn Engel wrote: Could a naïve implementation of this get exploited by doing a large number of truncates that just shave single bytes off various files? Yeah, which is why _my_ naïve implementation would do it for truncate-to-zero instead of just _any_

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Jörn Engel
On Sun, 24 February 2008 18:57:32 +0800, David Woodhouse wrote: On Sun, 2008-02-24 at 07:57 +0100, Jörn Engel wrote: Could a naïve implementation of this get exploited by doing a large number of truncates that just shave single bytes off various files? Yeah, which is why _my_ naïve

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Jamie Lokier
Pavel Machek wrote: You need to write a log entry indicating the new length of the file. There is no space for new log entries. There is a special case for removal -- 'rm gps.nmea' would work. Perhaps we should add a special case for truncation too, so that it can also use the extra

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Pavel Machek
On Sun 2008-02-24 18:57:32, David Woodhouse wrote: On Sun, 2008-02-24 at 07:57 +0100, Jörn Engel wrote: Could a na??ve implementation of this get exploited by doing a large number of truncates that just shave single bytes off various files? Yeah, which is why _my_ na??ve implementation

Re: jffs2: -ENOSPC when truncating file?!

2008-02-24 Thread Alexander Belyakov
On Sun, Feb 24, 2008 at 2:57 AM, Pavel Machek [EMAIL PROTECTED] wrote: Hi! I'm trying to free space by truncating big file, and I get: [EMAIL PROTECTED]:~# ls -al gps.nmea -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea [EMAIL PROTECTED]:~# gps.nmea -sh: cannot

Re: jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread Pavel Machek
On Sun 2008-02-24 09:36:07, David Woodhouse wrote: > > On Sun, 2008-02-24 at 00:57 +0100, Pavel Machek wrote: > > Hi! > > > > I'm trying to free space by truncating big file, and I get: > > > > [EMAIL PROTECTED]:~# ls -al gps.nmea > > -rw-r--r--1 root root 2332070 Feb 19 22:13

Re: jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread Jörn Engel
On Sun, 24 February 2008 09:36:07 +0900, David Woodhouse wrote: > On Sun, 2008-02-24 at 00:57 +0100, Pavel Machek wrote: > > > > I'm trying to free space by truncating big file, and I get: > > > > [EMAIL PROTECTED]:~# ls -al gps.nmea > > -rw-r--r--1 root root 2332070 Feb 19 22:13

Re: jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread David Woodhouse
On Sun, 2008-02-24 at 00:57 +0100, Pavel Machek wrote: > Hi! > > I'm trying to free space by truncating big file, and I get: > > [EMAIL PROTECTED]:~# ls -al gps.nmea > -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea > [EMAIL PROTECTED]:~# > gps.nmea > -sh: cannot create

jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread Pavel Machek
Hi! I'm trying to free space by truncating big file, and I get: [EMAIL PROTECTED]:~# ls -al gps.nmea -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea [EMAIL PROTECTED]:~# > gps.nmea -sh: cannot create gps.nmea: No space left on device [EMAIL PROTECTED]:~# rm gps.nmea [EMAIL

jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread Pavel Machek
Hi! I'm trying to free space by truncating big file, and I get: [EMAIL PROTECTED]:~# ls -al gps.nmea -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea [EMAIL PROTECTED]:~# gps.nmea -sh: cannot create gps.nmea: No space left on device [EMAIL PROTECTED]:~# rm gps.nmea [EMAIL

Re: jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread David Woodhouse
On Sun, 2008-02-24 at 00:57 +0100, Pavel Machek wrote: Hi! I'm trying to free space by truncating big file, and I get: [EMAIL PROTECTED]:~# ls -al gps.nmea -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea [EMAIL PROTECTED]:~# gps.nmea -sh: cannot create gps.nmea: No

Re: jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread Jörn Engel
On Sun, 24 February 2008 09:36:07 +0900, David Woodhouse wrote: On Sun, 2008-02-24 at 00:57 +0100, Pavel Machek wrote: I'm trying to free space by truncating big file, and I get: [EMAIL PROTECTED]:~# ls -al gps.nmea -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea

Re: jffs2: -ENOSPC when truncating file?!

2008-02-23 Thread Pavel Machek
On Sun 2008-02-24 09:36:07, David Woodhouse wrote: On Sun, 2008-02-24 at 00:57 +0100, Pavel Machek wrote: Hi! I'm trying to free space by truncating big file, and I get: [EMAIL PROTECTED]:~# ls -al gps.nmea -rw-r--r--1 root root 2332070 Feb 19 22:13 gps.nmea [EMAIL