[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <04C493C2-1D8D-41B7-955A-F5C5B08023BB@kernel.crashing.org>
Date: Mon, 19 Feb 2007 15:58:53 -0600
From: Kumar Gala <galak@...nel.crashing.org>
To: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc: Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: 2.6.20 kernel hang with USB drive and vfat doing ftruncate
On Feb 18, 2007, at 10:10 AM, OGAWA Hirofumi wrote:
> Kumar Gala <galak@...nel.crashing.org> writes:
>
>> I'm seeing an issue with a stock 2.6.20 kernel running on an embedded
>> PPC. I've got a usb flash drive plugged in and the filesystem on the
>> drive is vfat. Running with 64M and no swap.
>>
>> If I execute a series of large (100M+) ftruncate() on the disk the
>> kernel will hang and never return. It seems to be stuck in the idle
>> loop().
>>
>> The following is the test program I'm running:
>>
>> #include <sys/mman.h>
>> #include <sys/types.h>
>> #include <sys/stat.h>
>> #include <fcntl.h>
>> #include <stdio.h>
>> #include <unistd.h>
>> #include <errno.h>
>>
>> void usage (void)
>> {
>> printf ("truncate_test <filename> <size>\n\n");
>> }
>>
>> int main(int argc, char *argv[])
>> {
>> int fd, i;
>> int ret = 0;
>> unsigned int len;
>>
>> if (argc != 3) {
>> printf("Invalid number of arguments\n\n");
>> usage();
>> exit(1);
>> }
>>
>> fd = open(argv[1], O_CREAT|O_RDWR|O_TRUNC, S_IRWXU);
>> len = strtoul(argv[2], NULL, 0);
>>
>> ret = ftruncate(fd, len);
>>
>> if (ret)
>> printf ("ftruncate ret = %d %d\n", ret, errno);
>>
>> close(fd);
>>
>> return ret;
>> }
>>
>> I usually run the following twice to get the hang state:
>>
>> time ./trunc_test bar 100000000 &
>> time ./trunc_test baz 100000000 &
>>
>> I was wondering if anyone had any suggestions on what to poke at next
>> to try and figure out what is going on.
>
> Can you check /sys/block/xxx/stat or something to make sure there is
> no outstanding IO request?
>
> It seems to be no response from the lower layer...
Once the system locks up I dont have any ability to do anything.
- k
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists