Dmitry Monakhov dbf9d7da33 ext4: fix uniniatilized extent splitting error
Fix bug reported by Dmitry Monakhov caused by lost error code

    Testcase: 

    blksize = 0x1000;
    fd = open(argv[1], O_RDWR|O_CREAT, 0700);
    unsigned long long sz = 0x10000000UL;
    /* allocating big blocks chunk */
    syscall(__NR_fallocate, fd, 0, 0UL, sz)

    /* grab all other available filesystem space */
    tfd = open("tmp", O_RDWR|O_CREAT|O_DIRECT, 0700);
    while( write(tfd, buf, 4096) > 0); /* loop untill ENOSPC */
    fsync(fd); /* just in case */
    while (pos < sz) {
    	/* each seek+ write operation result in splits uninitialized extent
    	in three extents. Splitting may result in new extent allocation
    	which probably will fail because of ENOSPC*/

    	lseek(fd, blksize*2 -1, SEEK_CUR);
    	if ((ret = write(fd, 'a', 1)) != 1)
    		exit(1);
    	pos += blksize * 2;
    }

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-28 23:58:27 -05:00
..
2007-10-17 08:42:47 -07:00
2008-01-28 23:58:27 -05:00
2007-10-19 11:53:37 -07:00
2007-12-05 09:25:20 -08:00
2008-01-25 10:12:41 +00:00
2007-10-22 08:13:21 -07:00
2008-01-17 15:38:58 -08:00
2007-10-16 09:43:07 -07:00
2008-01-24 16:13:21 -06:00
2007-10-18 14:37:31 -07:00
2007-11-03 12:27:21 -07:00
2008-01-25 15:05:48 -08:00
2008-01-25 21:08:34 +01:00
2007-11-14 18:45:43 -08:00
2007-12-05 09:21:18 -08:00
2008-01-11 18:05:04 +11:00
2008-01-07 14:55:37 -08:00
2007-10-17 08:42:54 -07:00
2007-07-29 17:09:29 -07:00
2007-10-16 09:42:53 -07:00
2007-11-28 10:58:01 -08:00
2007-07-16 09:05:48 -07:00
2008-01-28 23:58:27 -05:00
2007-10-22 08:13:19 -07:00
2007-10-16 09:42:54 -07:00
2007-07-19 10:04:45 -07:00
2007-11-14 18:45:42 -08:00
2007-10-15 17:00:19 +02:00
2007-07-27 15:40:13 -07:00
2007-10-19 11:53:41 -07:00
2007-10-17 08:43:01 -07:00
2007-10-17 08:42:52 -07:00