Commit 52fdd781 authored by Anton Altaparmakov's avatar Anton Altaparmakov

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.
parent 80e4e144
......@@ -247,6 +247,8 @@ 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:
- Small internal cleanups.
- Support for sendfile system call. (Christoph Hellwig)
......
......@@ -2,6 +2,16 @@ ToDo:
- Find and fix bugs.
- 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.
- Treat BUG_ON() as ASSERT() not VERIFY(), i.e. do not use side effects
......
......@@ -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 \
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)
EXTRA_CFLAGS += -DDEBUG
......
......@@ -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
* 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.
*
* Contains an adapted version of fs/buffer.c::block_read_full_page().
......@@ -182,8 +185,10 @@ static int ntfs_read_block(struct page *page)
if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0);
bh = head = page_buffers(page);
if (unlikely(!bh))
if (unlikely(!bh)) {
unlock_page(page);
return -ENOMEM;
}
iblock = page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
lblock = (ni->allocated_size + blocksize - 1) >> blocksize_bits;
......@@ -343,8 +348,16 @@ int ntfs_readpage(struct file *file, struct page *page)
u32 attr_len;
int err = 0;
if (unlikely(!PageLocked(page)))
PAGE_BUG(page);
BUG_ON(!PageLocked(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);
......
......@@ -51,9 +51,6 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
struct file_operations ntfs_file_ops = {
.llseek = generic_file_llseek, /* Seek inside 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. */
.sendfile = generic_file_sendfile,/* Zero-copy data send with 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