aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-20 11:49:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-20 11:49:03 -0400
commita28ad14e057b6ec2ad9a8b09a44aa859d79c0ff8 (patch)
treed59b703629e6dddc2c4755888ddd2df3d2634fa4
parentc3f8f7fa8b19e274e7eb99dee428ad3a9b2ad8eb (diff)
parente952813e210b3addaea063da64ef68c3f30c0aa2 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull misc filesystem fixes from Jan Kara: "A fix for an isofs change apparently breaking mount(8) in some cases and one ext2 warning fix" * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2: avoid bogus -Wmaybe-uninitialized warning isofs: Do not return EACCES for unknown filesystems
-rw-r--r--fs/ext2/inode.c7
-rw-r--r--fs/isofs/inode.c8
2 files changed, 9 insertions, 6 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index d831e24dc885..41b8b44a391c 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -622,7 +622,7 @@ static int ext2_get_blocks(struct inode *inode,
622 u32 *bno, bool *new, bool *boundary, 622 u32 *bno, bool *new, bool *boundary,
623 int create) 623 int create)
624{ 624{
625 int err = -EIO; 625 int err;
626 int offsets[4]; 626 int offsets[4];
627 Indirect chain[4]; 627 Indirect chain[4];
628 Indirect *partial; 628 Indirect *partial;
@@ -639,7 +639,7 @@ static int ext2_get_blocks(struct inode *inode,
639 depth = ext2_block_to_path(inode,iblock,offsets,&blocks_to_boundary); 639 depth = ext2_block_to_path(inode,iblock,offsets,&blocks_to_boundary);
640 640
641 if (depth == 0) 641 if (depth == 0)
642 return (err); 642 return -EIO;
643 643
644 partial = ext2_get_branch(inode, depth, offsets, chain, &err); 644 partial = ext2_get_branch(inode, depth, offsets, chain, &err);
645 /* Simplest case - block found, no allocation needed */ 645 /* Simplest case - block found, no allocation needed */
@@ -761,7 +761,6 @@ static int ext2_get_blocks(struct inode *inode,
761 ext2_splice_branch(inode, iblock, partial, indirect_blks, count); 761 ext2_splice_branch(inode, iblock, partial, indirect_blks, count);
762 mutex_unlock(&ei->truncate_mutex); 762 mutex_unlock(&ei->truncate_mutex);
763got_it: 763got_it:
764 *bno = le32_to_cpu(chain[depth-1].key);
765 if (count > blocks_to_boundary) 764 if (count > blocks_to_boundary)
766 *boundary = true; 765 *boundary = true;
767 err = count; 766 err = count;
@@ -772,6 +771,8 @@ cleanup:
772 brelse(partial->bh); 771 brelse(partial->bh);
773 partial--; 772 partial--;
774 } 773 }
774 if (err > 0)
775 *bno = le32_to_cpu(chain[depth-1].key);
775 return err; 776 return err;
776} 777}
777 778
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index ad0c745ebad7..871c8b392099 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -687,6 +687,11 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
687 pri_bh = NULL; 687 pri_bh = NULL;
688 688
689root_found: 689root_found:
690 /* We don't support read-write mounts */
691 if (!(s->s_flags & MS_RDONLY)) {
692 error = -EACCES;
693 goto out_freebh;
694 }
690 695
691 if (joliet_level && (pri == NULL || !opt.rock)) { 696 if (joliet_level && (pri == NULL || !opt.rock)) {
692 /* This is the case of Joliet with the norock mount flag. 697 /* This is the case of Joliet with the norock mount flag.
@@ -1501,9 +1506,6 @@ struct inode *__isofs_iget(struct super_block *sb,
1501static struct dentry *isofs_mount(struct file_system_type *fs_type, 1506static struct dentry *isofs_mount(struct file_system_type *fs_type,
1502 int flags, const char *dev_name, void *data) 1507 int flags, const char *dev_name, void *data)
1503{ 1508{
1504 /* We don't support read-write mounts */
1505 if (!(flags & MS_RDONLY))
1506 return ERR_PTR(-EACCES);
1507 return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super); 1509 return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
1508} 1510}
1509 1511