diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-30 19:57:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-30 19:57:18 -0500 |
commit | 086486e46e4206cfa1140fb9682ad67c8a4502fb (patch) | |
tree | 35624c1b5f89a6b4d2b9e5e0364706165f7f7dd3 /fs | |
parent | a95251b8bac4a91a43db795a7193545dac65f4f4 (diff) | |
parent | c772aa92b6deb2857d4b39a5cc3bd3679cc5f4a6 (diff) |
Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French:
"Two low risk, small fixes, that fix cifs regressions introduced in
3.7."
* 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
CIFS: Fix wrong buffer pointer usage in smb_set_file_info
cifs: fix writeback race with file that is growing
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/file.c | 6 | ||||
-rw-r--r-- | fs/cifs/smb1ops.c | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index edb25b4bbb95..70b6f4c3a0c1 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1794,7 +1794,6 @@ static int cifs_writepages(struct address_space *mapping, | |||
1794 | struct TCP_Server_Info *server; | 1794 | struct TCP_Server_Info *server; |
1795 | struct page *page; | 1795 | struct page *page; |
1796 | int rc = 0; | 1796 | int rc = 0; |
1797 | loff_t isize = i_size_read(mapping->host); | ||
1798 | 1797 | ||
1799 | /* | 1798 | /* |
1800 | * If wsize is smaller than the page cache size, default to writing | 1799 | * If wsize is smaller than the page cache size, default to writing |
@@ -1899,7 +1898,7 @@ retry: | |||
1899 | */ | 1898 | */ |
1900 | set_page_writeback(page); | 1899 | set_page_writeback(page); |
1901 | 1900 | ||
1902 | if (page_offset(page) >= isize) { | 1901 | if (page_offset(page) >= i_size_read(mapping->host)) { |
1903 | done = true; | 1902 | done = true; |
1904 | unlock_page(page); | 1903 | unlock_page(page); |
1905 | end_page_writeback(page); | 1904 | end_page_writeback(page); |
@@ -1932,7 +1931,8 @@ retry: | |||
1932 | wdata->offset = page_offset(wdata->pages[0]); | 1931 | wdata->offset = page_offset(wdata->pages[0]); |
1933 | wdata->pagesz = PAGE_CACHE_SIZE; | 1932 | wdata->pagesz = PAGE_CACHE_SIZE; |
1934 | wdata->tailsz = | 1933 | wdata->tailsz = |
1935 | min(isize - page_offset(wdata->pages[nr_pages - 1]), | 1934 | min(i_size_read(mapping->host) - |
1935 | page_offset(wdata->pages[nr_pages - 1]), | ||
1936 | (loff_t)PAGE_CACHE_SIZE); | 1936 | (loff_t)PAGE_CACHE_SIZE); |
1937 | wdata->bytes = ((nr_pages - 1) * PAGE_CACHE_SIZE) + | 1937 | wdata->bytes = ((nr_pages - 1) * PAGE_CACHE_SIZE) + |
1938 | wdata->tailsz; | 1938 | wdata->tailsz; |
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 56cc4be87807..34cea2798333 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -766,7 +766,6 @@ smb_set_file_info(struct inode *inode, const char *full_path, | |||
766 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 766 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
767 | struct tcon_link *tlink = NULL; | 767 | struct tcon_link *tlink = NULL; |
768 | struct cifs_tcon *tcon; | 768 | struct cifs_tcon *tcon; |
769 | FILE_BASIC_INFO info_buf; | ||
770 | 769 | ||
771 | /* if the file is already open for write, just use that fileid */ | 770 | /* if the file is already open for write, just use that fileid */ |
772 | open_file = find_writable_file(cinode, true); | 771 | open_file = find_writable_file(cinode, true); |
@@ -817,7 +816,7 @@ smb_set_file_info(struct inode *inode, const char *full_path, | |||
817 | netpid = current->tgid; | 816 | netpid = current->tgid; |
818 | 817 | ||
819 | set_via_filehandle: | 818 | set_via_filehandle: |
820 | rc = CIFSSMBSetFileInfo(xid, tcon, &info_buf, netfid, netpid); | 819 | rc = CIFSSMBSetFileInfo(xid, tcon, buf, netfid, netpid); |
821 | if (!rc) | 820 | if (!rc) |
822 | cinode->cifsAttrs = le32_to_cpu(buf->Attributes); | 821 | cinode->cifsAttrs = le32_to_cpu(buf->Attributes); |
823 | 822 | ||