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 314123 Details for
Bug 456453
GFS2: d_rwdirectempty fails with short read
[?]
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]
Port of upstream fix.
move_size_check.patch (text/plain), 5.36 KB, created by
Ben Marzinski
on 2008-08-12 18:20:35 UTC
(
hide
)
Description:
Port of upstream fix.
Filename:
MIME Type:
Creator:
Ben Marzinski
Created:
2008-08-12 18:20:35 UTC
Size:
5.36 KB
patch
obsolete
>Index: rhel-kernel/mm/filemap.c >=================================================================== >--- rhel-kernel.orig/mm/filemap.c >+++ rhel-kernel/mm/filemap.c >@@ -908,12 +908,10 @@ void do_generic_mapping_read(struct addr > { > struct inode *inode = mapping->host; > unsigned long index; >- unsigned long end_index; > unsigned long offset; > unsigned long last_index; > unsigned long next_index; > unsigned long prev_index; >- loff_t isize; > struct page *cached_page; > int error; > struct file_ra_state ra = *_ra; >@@ -925,27 +923,12 @@ void do_generic_mapping_read(struct addr > last_index = (*ppos + desc->count + PAGE_CACHE_SIZE-1) >> PAGE_CACHE_SHIFT; > offset = *ppos & ~PAGE_CACHE_MASK; > >- isize = i_size_read(inode); >- if (!isize) >- goto out; >- >- end_index = (isize - 1) >> PAGE_CACHE_SHIFT; > for (;;) { > struct page *page; >+ unsigned long end_index; >+ loff_t isize; > unsigned long nr, ret; > >- /* nr is the maximum number of bytes to copy from this page */ >- nr = PAGE_CACHE_SIZE; >- if (index >= end_index) { >- if (index > end_index) >- goto out; >- nr = ((isize - 1) & ~PAGE_CACHE_MASK) + 1; >- if (nr <= offset) { >- goto out; >- } >- } >- nr = nr - offset; >- > cond_resched(); > if (index == next_index) > next_index = page_cache_readahead(mapping, &ra, filp, >@@ -970,6 +953,32 @@ find_page: > goto page_not_up_to_date; > } > page_ok: >+ /* >+ * i_size must be checked after we know the page is Uptodate. >+ * >+ * Checking i_size after the check allows us to calculate >+ * the correct value for "nr", which means the zero-filled >+ * part of the page is not copied back to userspace (unless >+ * another truncate extends the file - this is desired though). >+ */ >+ >+ isize = i_size_read(inode); >+ end_index = (isize - 1) >> PAGE_CACHE_SHIFT; >+ if (unlikely(!isize || index > end_index)) { >+ page_cache_release(page); >+ goto out; >+ } >+ >+ /* nr is the maximum number of bytes to copy from this page */ >+ nr = PAGE_CACHE_SIZE; >+ if (index == end_index) { >+ nr = ((isize - 1) & ~PAGE_CACHE_MASK) + 1; >+ if (nr <= offset) { >+ page_cache_release(page); >+ goto out; >+ } >+ } >+ nr = nr - offset; > > /* If users can be writing to this page using arbitrary > * virtual addresses, take care about potential aliasing >@@ -1054,31 +1063,6 @@ readpage: > unlock_page(page); > } > >- /* >- * i_size must be checked after we have done ->readpage. >- * >- * Checking i_size after the readpage allows us to calculate >- * the correct value for "nr", which means the zero-filled >- * part of the page is not copied back to userspace (unless >- * another truncate extends the file - this is desired though). >- */ >- isize = i_size_read(inode); >- end_index = (isize - 1) >> PAGE_CACHE_SHIFT; >- if (unlikely(!isize || index > end_index)) { >- page_cache_release(page); >- goto out; >- } >- >- /* nr is the maximum number of bytes to copy from this page */ >- nr = PAGE_CACHE_SIZE; >- if (index == end_index) { >- nr = ((isize - 1) & ~PAGE_CACHE_MASK) + 1; >- if (nr <= offset) { >- page_cache_release(page); >- goto out; >- } >- } >- nr = nr - offset; > goto page_ok; > > readpage_error: >Index: rhel-kernel/fs/ntfs/aops.c >=================================================================== >--- rhel-kernel.orig/fs/ntfs/aops.c >+++ rhel-kernel/fs/ntfs/aops.c >@@ -410,6 +410,15 @@ static int ntfs_readpage(struct file *fi > > retry_readpage: > BUG_ON(!PageLocked(page)); >+ vi = page->mapping->host; >+ i_size = i_size_read(vi); >+ /* Is the page fully outside i_size? (truncate in progress) */ >+ if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >> >+ PAGE_CACHE_SHIFT)) { >+ zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0); >+ ntfs_debug("Read outside i_size - truncated?"); >+ goto done; >+ } > /* > * This can potentially happen because we clear PageUptodate() during > * ntfs_writepage() of MstProtected() attributes. >@@ -418,7 +427,6 @@ retry_readpage: > unlock_page(page); > return 0; > } >- vi = page->mapping->host; > ni = NTFS_I(vi); > /* > * Only $DATA attributes can be encrypted and only unnamed $DATA >Index: rhel-kernel/fs/ntfs/attrib.c >=================================================================== >--- rhel-kernel.orig/fs/ntfs/attrib.c >+++ rhel-kernel/fs/ntfs/attrib.c >@@ -179,10 +179,7 @@ int ntfs_map_runlist_nolock(ntfs_inode * > * ntfs_mapping_pairs_decompress() fails. > */ > end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn) + 1; >- if (!a->data.non_resident.lowest_vcn && end_vcn == 1) >- end_vcn = sle64_to_cpu(a->data.non_resident.allocated_size) >> >- ni->vol->cluster_size_bits; >- if (unlikely(vcn >= end_vcn)) { >+ if (unlikely(vcn && vcn >= end_vcn)) { > err = -ENOENT; > goto err_out; > } >Index: rhel-kernel/fs/ntfs/compress.c >=================================================================== >--- rhel-kernel.orig/fs/ntfs/compress.c >+++ rhel-kernel/fs/ntfs/compress.c >@@ -561,6 +561,16 @@ int ntfs_read_compressed_block(struct pa > read_unlock_irqrestore(&ni->size_lock, flags); > max_page = ((i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) - > offset; >+ /* Is the page fully outside i_size? (truncate in progress) */ >+ if (xpage >= max_page) { >+ kfree(bhs); >+ kfree(pages); >+ zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0); >+ ntfs_debug("Compressed read outside i_size - truncated?"); >+ SetPageUptodate(page); >+ unlock_page(page); >+ return 0; >+ } > if (nr_pages < max_page) > max_page = nr_pages; > for (i = 0; i < max_page; i++, offset++) {
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 456453
:
312687
| 314123