summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-05-03 10:11:46 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2010-05-03 10:11:46 +1000
commit4110400a12fe53b5fc876ef9430a6f6ce791d99b (patch)
treecbaff0bc57db23cc9363f664f4c9c7180305c2fd /fs
parentc1acdd9563a701a30e1f21f4e9712585970e7590 (diff)
parentccc0197b02178f7e1707e659cbc5242fc94b499a (diff)
Merge remote branch 'logfs/master'
Diffstat (limited to 'fs')
-rw-r--r--fs/logfs/inode.c2
-rw-r--r--fs/logfs/readwrite.c4
-rw-r--r--fs/logfs/super.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/fs/logfs/inode.c b/fs/logfs/inode.c
index 14ed27274da2..45bf86f1595a 100644
--- a/fs/logfs/inode.c
+++ b/fs/logfs/inode.c
@@ -326,7 +326,7 @@ static void logfs_set_ino_generation(struct super_block *sb,
u64 ino;
mutex_lock(&super->s_journal_mutex);
- ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino);
+ ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino + 1);
super->s_last_ino = ino;
super->s_inos_till_wrap--;
if (super->s_inos_till_wrap < 0) {
diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c
index 3159db6958e5..e37cee3b1007 100644
--- a/fs/logfs/readwrite.c
+++ b/fs/logfs/readwrite.c
@@ -892,6 +892,8 @@ u64 logfs_seek_hole(struct inode *inode, u64 bix)
return bix;
else if (li->li_data[INDIRECT_INDEX] & LOGFS_FULLY_POPULATED)
bix = maxbix(li->li_height);
+ else if (bix >= maxbix(li->li_height))
+ return bix;
else {
bix = seek_holedata_loop(inode, bix, 0);
if (bix < maxbix(li->li_height))
@@ -1861,7 +1863,7 @@ int logfs_truncate(struct inode *inode, u64 target)
size = target;
logfs_get_wblocks(sb, NULL, 1);
- err = __logfs_truncate(inode, target);
+ err = __logfs_truncate(inode, size);
if (!err)
err = __logfs_write_inode(inode, 0);
logfs_put_wblocks(sb, NULL, 1);
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index 5866ee6e1327..edd99487f93a 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -382,7 +382,7 @@ static struct page *find_super_block(struct super_block *sb)
if (!first || IS_ERR(first))
return NULL;
last = super->s_devops->find_last_sb(sb, &super->s_sb_ofs[1]);
- if (!last || IS_ERR(first)) {
+ if (!last || IS_ERR(last)) {
page_cache_release(first);
return NULL;
}
@@ -413,7 +413,7 @@ static int __logfs_read_sb(struct super_block *sb)
page = find_super_block(sb);
if (!page)
- return -EIO;
+ return -EINVAL;
ds = page_address(page);
super->s_size = be64_to_cpu(ds->ds_filesystem_size);