Bug 13469 - fscache crash
Summary: fscache crash
Status: CLOSED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 high
Assignee: David Howells
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-07 09:20 UTC by Adrian von Bidder
Modified: 2010-01-25 15:35 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.30-rc8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Patch to stop cachefiles from writing to much data to the backing file (4.78 KB, patch)
2009-06-11 14:20 UTC, David Howells
Details | Diff

Description Adrian von Bidder 2009-06-07 09:20:31 UTC
Using Debian 2.6.30-rc8 packages on a 686.

fsc is mounted & started, reading from those files the cache starts to be populated ok, but re-reading these files immediately creates the following stack trace:
+++
Jun  6 18:59:58 syydelaervli kernel: [ 1107.260445] Pid: 2104, comm: kslowd Not tainted 2.6.30-rc8-686 #1                                                       
Jun  6 18:59:59 syydelaervli kernel: [ 1107.260535] Call Trace:
Jun  6 18:59:59 syydelaervli kernel: [ 1107.260656]  [<c917c6ee>] ? cachefiles_read_waiter+0x45/0xc0 [cachefiles]                                               
Jun  6 18:59:59 syydelaervli kernel: [ 1107.260762]  [<c011bce5>] ? __wake_up_common+0x34/0x59                                                                  
Jun  6 18:59:59 syydelaervli kernel: [ 1107.260849]  [<c011c5af>] ? __wake_up+0x29/0x39                                                                         
Jun  6 18:59:59 syydelaervli kernel: [ 1107.260941]  [<c0136869>] ? __wake_up_bit+0x29/0x2e                                                                     
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261151]  [<c8abde27>] ? ext3_truncate+0x365/0x710 [ext3]
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261262]  [<c017b13b>] ? vmtruncate+0xf6/0x119
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261343]  [<c019c011>] ? inode_setattr+0x4b/0x11b
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261496]  [<c8abbccd>] ? ext3_setattr+0x156/0x1ab [ext3]
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261583]  [<c019c233>] ? notify_change+0x152/0x28f
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261674]  [<c01a8000>] ? block_read_full_page+0x233/0x270
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261778]  [<c917a2bc>] ? cachefiles_attr_changed+0xfb/0x156 [cachefiles]
Jun  6 18:59:59 syydelaervli kernel: [ 1107.261933]  [<c8ff6f6c>] ? fscache_lookup_object+0xe2/0xf4 [fscache]
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262052]  [<c8ff7357>] ? fscache_object_slow_work_execute+0x187/0x567 [fscache]
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262160]  [<c0169f55>] ? slow_work_thread+0x264/0x3f3
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262248]  [<c01368ca>] ? autoremove_wake_function+0x0/0x2d
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262331]  [<c0169cf1>] ? slow_work_thread+0x0/0x3f3
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262412]  [<c01365dc>] ? kthread+0x42/0x67
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262490]  [<c013659a>] ? kthread+0x0/0x67
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262584]  [<c0103ab7>] ? kernel_thread_helper+0x7/0x10
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262777] CacheFiles: I/O Error: Readpage failed on backing file 40000830
Jun  6 18:59:59 syydelaervli kernel: [ 1107.262862] FS-Cache: Cache cachefiles stopped due to I/O error
+++

(this one if using nfs3, but nfs4 behaves the same.)
Comment 1 Andrew Morton 2009-06-09 21:19:33 UTC
Reassigned to dhowells.
Comment 2 David Howells 2009-06-09 22:58:16 UTC
I've come across this one.  I have a tentative patch to fix it that I've given to someone else to test.
Comment 3 David Howells 2009-06-11 14:20:55 UTC
Created attachment 21853 [details]
Patch to stop cachefiles from writing to much data to the backing file

Can you try this patch please?  I think it should fix the problem, which is that cachefiles currently writes beyond the EOF when the netfs inode's last page is a partial page.  This causes cachefiles to subsequently try to truncate the last page of the backing file to the expected file - which has consequences when we're also trying to read that page.
Comment 4 Adrian von Bidder 2009-06-13 15:36:40 UTC
Ok, hasn't crashed for me so far after a few 100M of the same kind of traffic as I tried originally.

(I've applied this on top of Debian's linux-source-2.6.30 package version 2.6.30-1~experimental.1~snapshot.13794.)

Thanks a lot.

cheers
-- vbi

Note You need to log in before you can comment on or make changes to this bug.