Commit 0fc27e84 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-ntfs.bkbits.net/ntfs-tng-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 9b7187ff 52fdd781
...@@ -247,6 +247,8 @@ ChangeLog ...@@ -247,6 +247,8 @@ ChangeLog
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog. Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
2.0.25:
- Minor bugfixes in error code paths and small cleanups.
2.0.24: 2.0.24:
- Small internal cleanups. - Small internal cleanups.
- Support for sendfile system call. (Christoph Hellwig) - Support for sendfile system call. (Christoph Hellwig)
......
...@@ -2,6 +2,16 @@ ToDo: ...@@ -2,6 +2,16 @@ ToDo:
- Find and fix bugs. - Find and fix bugs.
- Enable NFS exporting of NTFS. - Enable NFS exporting of NTFS.
2.0.25 - Small bug fixes and cleanups.
- Unlock the page in an out of memory error code path in
fs/ntfs/aops.c::ntfs_read_block().
- If fs/ntfs/aops.c::ntfs_read_page() is called on an uptodate page,
just unlock the page and return. (This can happen due to ->writepage
clearing PageUptodate() during write out of MstProtected()
attributes.
- Remove leaked write code again.
2.0.24 - Cleanups. 2.0.24 - Cleanups.
- Treat BUG_ON() as ASSERT() not VERIFY(), i.e. do not use side effects - Treat BUG_ON() as ASSERT() not VERIFY(), i.e. do not use side effects
......
...@@ -5,7 +5,7 @@ obj-$(CONFIG_NTFS_FS) += ntfs.o ...@@ -5,7 +5,7 @@ obj-$(CONFIG_NTFS_FS) += ntfs.o
ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \ ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \
mst.o namei.o super.o sysctl.o time.o unistr.o upcase.o mst.o namei.o super.o sysctl.o time.o unistr.o upcase.o
EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.24\" EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.25\"
ifeq ($(CONFIG_NTFS_DEBUG),y) ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG EXTRA_CFLAGS += -DDEBUG
......
...@@ -156,6 +156,9 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) ...@@ -156,6 +156,9 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
* applies the mst fixups to the page before finally marking it uptodate and * applies the mst fixups to the page before finally marking it uptodate and
* unlocking it. * unlocking it.
* *
* We only enforce allocated_size limit because i_size is checked for in
* generic_file_read().
*
* Return 0 on success and -errno on error. * Return 0 on success and -errno on error.
* *
* Contains an adapted version of fs/buffer.c::block_read_full_page(). * Contains an adapted version of fs/buffer.c::block_read_full_page().
...@@ -182,8 +185,10 @@ static int ntfs_read_block(struct page *page) ...@@ -182,8 +185,10 @@ static int ntfs_read_block(struct page *page)
if (!page_has_buffers(page)) if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0); create_empty_buffers(page, blocksize, 0);
bh = head = page_buffers(page); bh = head = page_buffers(page);
if (unlikely(!bh)) if (unlikely(!bh)) {
unlock_page(page);
return -ENOMEM; return -ENOMEM;
}
iblock = page->index << (PAGE_CACHE_SHIFT - blocksize_bits); iblock = page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
lblock = (ni->allocated_size + blocksize - 1) >> blocksize_bits; lblock = (ni->allocated_size + blocksize - 1) >> blocksize_bits;
...@@ -343,8 +348,16 @@ int ntfs_readpage(struct file *file, struct page *page) ...@@ -343,8 +348,16 @@ int ntfs_readpage(struct file *file, struct page *page)
u32 attr_len; u32 attr_len;
int err = 0; int err = 0;
if (unlikely(!PageLocked(page))) BUG_ON(!PageLocked(page));
PAGE_BUG(page);
/*
* This can potentially happen because we clear PageUptodate() during
* ntfs_writepage() of MstProtected() attributes.
*/
if (PageUptodate(page)) {
unlock_page(page);
return 0;
}
ni = NTFS_I(page->mapping->host); ni = NTFS_I(page->mapping->host);
......
...@@ -51,9 +51,6 @@ static int ntfs_file_open(struct inode *vi, struct file *filp) ...@@ -51,9 +51,6 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
struct file_operations ntfs_file_ops = { struct file_operations ntfs_file_ops = {
.llseek = generic_file_llseek, /* Seek inside file. */ .llseek = generic_file_llseek, /* Seek inside file. */
.read = generic_file_read, /* Read from file. */ .read = generic_file_read, /* Read from file. */
#ifdef NTFS_RW
.write = generic_file_write, /* Write to a file. */
#endif
.mmap = generic_file_mmap, /* Mmap file. */ .mmap = generic_file_mmap, /* Mmap file. */
.sendfile = generic_file_sendfile,/* Zero-copy data send with the .sendfile = generic_file_sendfile,/* Zero-copy data send with the
data source being on the data source being on the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment