Skip to content

Commit

Permalink
Merge branch 'fixes' of git://oss.oracle.com/git/tma/linux-2.6
Browse files Browse the repository at this point in the history
* 'fixes' of git://oss.oracle.com/git/tma/linux-2.6:
  ocfs2: Fix orphan add in ocfs2_create_inode_in_orphan
  ocfs2: split out ocfs2_prepare_orphan_dir() into locking and prep functions
  ocfs2: allow return of new inode block location before allocation of the inode
  ocfs2: use ocfs2_alloc_dinode_update_counts() instead of open coding
  ocfs2: split out inode alloc code from ocfs2_mknod_locked
  Ocfs2: Fix a regression bug from mainline commit(6b933c8).
  ocfs2: Fix deadlock when allocating page
  ocfs2: properly set and use inode group alloc hint
  ocfs2: Use the right group in nfs sync check.
  ocfs2: Flush drive's caches on fdatasync
  ocfs2: make __ocfs2_page_mkwrite handle file end properly.
  ocfs2: Fix incorrect checksum validation error
  ocfs2: Fix metaecc error messages
  • Loading branch information
Linus Torvalds committed Sep 9, 2010
2 parents cc491e2 + 97b8f4a commit cad4674
Show file tree
Hide file tree
Showing 9 changed files with 475 additions and 107 deletions.
2 changes: 1 addition & 1 deletion fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6672,7 +6672,7 @@ int ocfs2_grab_pages(struct inode *inode, loff_t start, loff_t end,
last_page_bytes = PAGE_ALIGN(end);
index = start >> PAGE_CACHE_SHIFT;
do {
pages[numpages] = grab_cache_page(mapping, index);
pages[numpages] = find_or_create_page(mapping, index, GFP_NOFS);
if (!pages[numpages]) {
ret = -ENOMEM;
mlog_errno(ret);
Expand Down
4 changes: 2 additions & 2 deletions fs/ocfs2/blockcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ int ocfs2_block_check_validate(void *data, size_t blocksize,

ocfs2_blockcheck_inc_failure(stats);
mlog(ML_ERROR,
"CRC32 failed: stored: %u, computed %u. Applying ECC.\n",
"CRC32 failed: stored: 0x%x, computed 0x%x. Applying ECC.\n",
(unsigned int)check.bc_crc32e, (unsigned int)crc);

/* Ok, try ECC fixups */
Expand All @@ -453,7 +453,7 @@ int ocfs2_block_check_validate(void *data, size_t blocksize,
goto out;
}

mlog(ML_ERROR, "Fixed CRC32 failed: stored: %u, computed %u\n",
mlog(ML_ERROR, "Fixed CRC32 failed: stored: 0x%x, computed 0x%x\n",
(unsigned int)check.bc_crc32e, (unsigned int)crc);

rc = -EIO;
Expand Down
15 changes: 12 additions & 3 deletions fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/writeback.h>
#include <linux/falloc.h>
#include <linux/quotaops.h>
#include <linux/blkdev.h>

#define MLOG_MASK_PREFIX ML_INODE
#include <cluster/masklog.h>
Expand Down Expand Up @@ -190,8 +191,16 @@ static int ocfs2_sync_file(struct file *file, int datasync)
if (err)
goto bail;

if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) {
/*
* We still have to flush drive's caches to get data to the
* platter
*/
if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER)
blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL,
NULL, BLKDEV_IFL_WAIT);
goto bail;
}

journal = osb->journal->j_journal;
err = jbd2_journal_force_commit(journal);
Expand Down Expand Up @@ -774,7 +783,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,
BUG_ON(abs_to > (((u64)index + 1) << PAGE_CACHE_SHIFT));
BUG_ON(abs_from & (inode->i_blkbits - 1));

page = grab_cache_page(mapping, index);
page = find_or_create_page(mapping, index, GFP_NOFS);
if (!page) {
ret = -ENOMEM;
mlog_errno(ret);
Expand Down Expand Up @@ -2329,7 +2338,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT));

if (((file->f_flags & O_DSYNC) && !direct_io) || IS_SYNC(inode) ||
((file->f_flags & O_DIRECT) && has_refcount)) {
((file->f_flags & O_DIRECT) && !direct_io)) {
ret = filemap_fdatawrite_range(file->f_mapping, pos,
pos + count - 1);
if (ret < 0)
Expand Down
6 changes: 5 additions & 1 deletion fs/ocfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,11 @@ static int ocfs2_read_locked_inode(struct inode *inode,
OCFS2_BH_IGNORE_CACHE);
} else {
status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
if (!status)
/*
* If buffer is in jbd, then its checksum may not have been
* computed as yet.
*/
if (!status && !buffer_jbd(bh))
status = ocfs2_validate_inode_block(osb->sb, bh);
}
if (status < 0) {
Expand Down
8 changes: 5 additions & 3 deletions fs/ocfs2/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
/*
* Another node might have truncated while we were waiting on
* cluster locks.
* We don't check size == 0 before the shift. This is borrowed
* from do_generic_file_read.
*/
last_index = size >> PAGE_CACHE_SHIFT;
if (page->index > last_index) {
last_index = (size - 1) >> PAGE_CACHE_SHIFT;
if (unlikely(!size || page->index > last_index)) {
ret = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -107,7 +109,7 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
* because the "write" would invalidate their data.
*/
if (page->index == last_index)
len = size & ~PAGE_CACHE_MASK;
len = ((size - 1) & ~PAGE_CACHE_MASK) + 1;

ret = ocfs2_write_begin_nolock(mapping, pos, len, 0, &locked_page,
&fsdata, di_bh, page);
Expand Down
Loading

0 comments on commit cad4674

Please sign in to comment.