View Incident:
http://co-op.engr.sgi.com/BugWorks/code/bwxquery.cgi?search=Search&wlong=1&view_type=Bug&wi=797457
Status : open Priority : 2
Assigned Engineer : ananth Submitter : ananth
*Modified User : ananth *Modified User Domain : engr
*Description :
In general, the kernel
shouldn't be swapping a page from a file on
which a write is in progress ... following is
a old backtrace but doio-2threads can reproduce
the problem at will on a 64MB system.
-------------
[1]kdb> btp 569
EBP EIP Function(args)
.....
==========================
ADDITIONAL INFORMATION (ADD)
From: ananth@engr (BugWorks)
Date: Sep 05 2000 05:22:58PM
==========================
Following is a workaround for this bug:
basically the scheme uses the fact that
writepage can return failure in the swapcase.
I'll do some more testing and check-in later.
-----------
===========================================================================
linux/fs/xfs/linux/xfs_iops.c
===========================================================================
802c802
< int
---
> STATIC int
805c805,806
< struct page *page)
---
> struct page *page,
> int wait)
821a823,825
> if (!wait)
> return -EBUSY;
>
832a837,852
> int
> linvfs_write_full_page_sync(
> struct file *filp,
> struct page *page)
> {
> return(linvfs_write_full_page(filp, page, 1));
> }
>
> int
> linvfs_write_full_page_async(
> struct file *filp,
> struct page *page)
> {
> return(linvfs_write_full_page(filp, page, 0));
> }
>
910c930
< writepage: linvfs_write_full_page,
---
> writepage: linvfs_write_full_page_sync,
913a934
> writepage_async: linvfs_write_full_page_async,
===========================================================================
linux/include/linux/fs.h
===========================================================================
364a365
> int (*writepage_async)(struct file *, struct page *);
===========================================================================
linux/mm/filemap.c
===========================================================================
1592c1592,1605
< return page->mapping->a_ops->writepage(file, page);
---
> if (wait) {
> return page->mapping->a_ops->writepage(file, page);
> } else {
> int (*wpf)(struct file *, struct page *);
>
> /*
> * If async write is supported call that
> * otherwise use synchronous write.
> */
> wpf = page->mapping->a_ops->writepage_async;
> if (!wpf)
> wpf = page->mapping->a_ops->writepage;
> return(wpf(file, page));
> }
===========================================================================
linux/mm/vmscan.c
===========================================================================
414c414,419
< if (!ret)
---
> /*
> * Kludge for XFS: if swap_out's write page
> * returned EBUSY due to filesystem locking
> * issues, be forgiving.
> */
> if (!ret || ret == -EBUSY)
-----------------
|