Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 306161 Details for
Bug 435291
LTC41974-Pages of a memory mapped NFS file get corrupted.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
435291.rhel-5 (text/plain), 4.75 KB, created by
Peter Staubach
on 2008-05-20 17:38:28 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Peter Staubach
Created:
2008-05-20 17:38:28 UTC
Size:
4.75 KB
patch
obsolete
>--- linux-2.6.18.i686/fs/nfs/inode.c.org >+++ linux-2.6.18.i686/fs/nfs/inode.c >@@ -709,7 +709,7 @@ int nfs_revalidate_mapping(struct inode > nfs_inc_stats(inode, NFSIOS_DATAINVALIDATE); > if (S_ISREG(inode->i_mode)) > nfs_sync_mapping(mapping); >- invalidate_inode_pages2(mapping); >+ invalidate_inode_pages3(mapping); > > spin_lock(&inode->i_lock); > nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; >--- linux-2.6.18.i686/include/linux/fs.h.org >+++ linux-2.6.18.i686/include/linux/fs.h >@@ -1577,6 +1578,9 @@ static inline void invalidate_remote_ino > extern int invalidate_inode_pages2(struct address_space *mapping); > extern int invalidate_inode_pages2_range(struct address_space *mapping, > pgoff_t start, pgoff_t end); >+extern int invalidate_inode_pages3(struct address_space *mapping); >+extern int invalidate_inode_pages3_range(struct address_space *mapping, >+ pgoff_t start, pgoff_t end); > extern int write_inode_now(struct inode *, int); > extern int filemap_fdatawrite(struct address_space *); > extern int filemap_flush(struct address_space *); >--- linux-2.6.18.i686/mm/truncate.c.org >+++ linux-2.6.18.i686/mm/truncate.c >@@ -408,3 +408,88 @@ int invalidate_inode_pages2(struct addre > return invalidate_inode_pages2_range(mapping, 0, -1); > } > EXPORT_SYMBOL_GPL(invalidate_inode_pages2); >+ >+/** >+ * invalidate_inode_pages3_range - remove range of pages from an address_space >+ * @mapping: the address_space >+ * @start: the page offset 'from' which to invalidate >+ * @end: the page offset 'to' which to invalidate (inclusive) >+ * >+ * Any pages which are found to be mapped into pagetables are unmapped prior to >+ * invalidation. >+ * >+ * Returns -EIO if any pages could not be invalidated. >+ */ >+int invalidate_inode_pages3_range(struct address_space *mapping, >+ pgoff_t start, pgoff_t end) >+{ >+ struct pagevec pvec; >+ pgoff_t next; >+ int i; >+ int ret = 0; >+ int wrapped = 0; >+ >+ pagevec_init(&pvec, 0); >+ next = start; >+ while (next <= end && !wrapped && >+ pagevec_lookup(&pvec, mapping, next, >+ min(end - next, (pgoff_t)PAGEVEC_SIZE - 1) + 1)) { >+ for (i = 0; i < pagevec_count(&pvec); i++) { >+ struct page *page = pvec.pages[i]; >+ pgoff_t page_index; >+ >+ lock_page(page); >+ if (page->mapping != mapping) { >+ unlock_page(page); >+ continue; >+ } >+ page_index = page->index; >+ next = page_index + 1; >+ if (next == 0) >+ wrapped = 1; >+ if (page_index > end) { >+ unlock_page(page); >+ break; >+ } >+ wait_on_page_writeback(page); >+ while (page_mapped(page)) { >+ unmap_mapping_range(mapping, >+ (loff_t)page_index<<PAGE_CACHE_SHIFT, >+ PAGE_CACHE_SIZE, 0); >+ } >+ if (!invalidate_complete_page2(mapping, page)) >+ ret = -EIO; >+ else { >+ /* >+ * Update the truncate_count. This should >+ * prevent any threads in do_no_page() >+ * who found this page in the page cache >+ * from using it. >+ */ >+ spin_lock(&mapping->i_mmap_lock); >+ mapping->truncate_count++; >+ spin_unlock(&mapping->i_mmap_lock); >+ } >+ unlock_page(page); >+ } >+ pagevec_release(&pvec); >+ cond_resched(); >+ } >+ return ret; >+} >+EXPORT_SYMBOL_GPL(invalidate_inode_pages3_range); >+ >+/** >+ * invalidate_inode_pages3 - remove all pages from an address_space >+ * @mapping: the address_space >+ * >+ * Any pages which are found to be mapped into pagetables are unmapped prior to >+ * invalidation. >+ * >+ * Returns -EIO if any pages could not be invalidated. >+ */ >+int invalidate_inode_pages3(struct address_space *mapping) >+{ >+ return invalidate_inode_pages3_range(mapping, 0, -1); >+} >+EXPORT_SYMBOL_GPL(invalidate_inode_pages3); >--- linux-2.6.18.i686/mm/memory.c.org >+++ linux-2.6.18.i686/mm/memory.c >@@ -2354,6 +2354,8 @@ retry: > } > } > >+ lock_page(new_page); >+ > page_table = pte_offset_map_lock(mm, pmd, address, &ptl); > /* > * For a file-backed vma, someone could have truncated or otherwise >@@ -2362,6 +2364,7 @@ retry: > */ > if (mapping && unlikely(sequence != mapping->truncate_count)) { > pte_unmap_unlock(page_table, ptl); >+ unlock_page(new_page); > page_cache_release(new_page); > cond_resched(); > sequence = mapping->truncate_count; >@@ -2393,16 +2396,19 @@ retry: > inc_mm_counter(mm, anon_rss); > lru_cache_add_active(new_page); > page_add_new_anon_rmap(new_page, vma, address); >+ unlock_page(new_page); > } else { > inc_mm_counter(mm, file_rss); > page_add_file_rmap(new_page); > if (write_access) { > dirty_page = new_page; > get_page(dirty_page); >- } >+ } else >+ unlock_page(new_page); > } > } else { > /* One of our sibling threads was faster, back out. */ >+ unlock_page(new_page); > page_cache_release(new_page); > goto unlock; > } >@@ -2414,6 +2420,7 @@ unlock: > if (dirty_page) { > if (flush_mmap_pages || !dirty_pte) > set_page_dirty_balance(dirty_page); >+ unlock_page(dirty_page); > put_page(dirty_page); > } > return ret;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435291
:
296231
|
296232
|
297648
|
297649
|
298407
|
306161
|
309133