diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 11:27:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 11:27:59 -0500 |
commit | fa4c95bfdb85d568ae327d57aa33a4f55bab79c4 (patch) | |
tree | 2f827ba303bbb5be30442388f298e1fe532da4d0 /fs | |
parent | 60da5bf47dd3d301a1d3bd4f0a4b9e29a184515c (diff) | |
parent | 56df127855b593cc4b2e94ce8df5c609b0109b42 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext3, udf, quota fixes from Jan Kara:
"Some ext3 & quota cleanups and couple of udf fixes"
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: Use the pre-processor to compile out quotactl_cmd_write when !CONFIG_BLOCK
ext3: drop if around WARN_ON
ext3: get rid of the duplicate code on ext3_fill_super
udf: remove un-needed variable from inode_getblk
udf: don't increment lenExtents while writing to a hole
udf: fix memory leak while allocating blocks during write
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext3/inode.c | 3 | ||||
-rw-r--r-- | fs/ext3/super.c | 3 | ||||
-rw-r--r-- | fs/quota/quota.c | 4 | ||||
-rw-r--r-- | fs/udf/inode.c | 14 |
4 files changed, 14 insertions, 10 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 7e87e37a372..b176d425354 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1071,8 +1071,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode, | |||
1071 | * mapped. 0 in case of a HOLE. | 1071 | * mapped. 0 in case of a HOLE. |
1072 | */ | 1072 | */ |
1073 | if (err > 0) { | 1073 | if (err > 0) { |
1074 | if (err > 1) | 1074 | WARN_ON(err > 1); |
1075 | WARN_ON(1); | ||
1076 | err = 0; | 1075 | err = 0; |
1077 | } | 1076 | } |
1078 | *errp = err; | 1077 | *errp = err; |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 5366393528d..6e50223b329 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -1661,9 +1661,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
1661 | return -ENOMEM; | 1661 | return -ENOMEM; |
1662 | } | 1662 | } |
1663 | sb->s_fs_info = sbi; | 1663 | sb->s_fs_info = sbi; |
1664 | sbi->s_mount_opt = 0; | ||
1665 | sbi->s_resuid = make_kuid(&init_user_ns, EXT3_DEF_RESUID); | ||
1666 | sbi->s_resgid = make_kgid(&init_user_ns, EXT3_DEF_RESGID); | ||
1667 | sbi->s_sb_block = sb_block; | 1664 | sbi->s_sb_block = sb_block; |
1668 | 1665 | ||
1669 | blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE); | 1666 | blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE); |
diff --git a/fs/quota/quota.c b/fs/quota/quota.c index af1661f7a54..c7314f1771f 100644 --- a/fs/quota/quota.c +++ b/fs/quota/quota.c | |||
@@ -307,6 +307,8 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, | |||
307 | } | 307 | } |
308 | } | 308 | } |
309 | 309 | ||
310 | #ifdef CONFIG_BLOCK | ||
311 | |||
310 | /* Return 1 if 'cmd' will block on frozen filesystem */ | 312 | /* Return 1 if 'cmd' will block on frozen filesystem */ |
311 | static int quotactl_cmd_write(int cmd) | 313 | static int quotactl_cmd_write(int cmd) |
312 | { | 314 | { |
@@ -322,6 +324,8 @@ static int quotactl_cmd_write(int cmd) | |||
322 | return 1; | 324 | return 1; |
323 | } | 325 | } |
324 | 326 | ||
327 | #endif /* CONFIG_BLOCK */ | ||
328 | |||
325 | /* | 329 | /* |
326 | * look up a superblock on which quota ops will be performed | 330 | * look up a superblock on which quota ops will be performed |
327 | * - use the name of a block device to find the superblock thereon | 331 | * - use the name of a block device to find the superblock thereon |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index df88b957ccf..cbae1ed0b7c 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -587,7 +587,6 @@ out: | |||
587 | static sector_t inode_getblk(struct inode *inode, sector_t block, | 587 | static sector_t inode_getblk(struct inode *inode, sector_t block, |
588 | int *err, int *new) | 588 | int *err, int *new) |
589 | { | 589 | { |
590 | static sector_t last_block; | ||
591 | struct kernel_long_ad laarr[EXTENT_MERGE_SIZE]; | 590 | struct kernel_long_ad laarr[EXTENT_MERGE_SIZE]; |
592 | struct extent_position prev_epos, cur_epos, next_epos; | 591 | struct extent_position prev_epos, cur_epos, next_epos; |
593 | int count = 0, startnum = 0, endnum = 0; | 592 | int count = 0, startnum = 0, endnum = 0; |
@@ -601,6 +600,7 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, | |||
601 | struct udf_inode_info *iinfo = UDF_I(inode); | 600 | struct udf_inode_info *iinfo = UDF_I(inode); |
602 | int goal = 0, pgoal = iinfo->i_location.logicalBlockNum; | 601 | int goal = 0, pgoal = iinfo->i_location.logicalBlockNum; |
603 | int lastblock = 0; | 602 | int lastblock = 0; |
603 | bool isBeyondEOF; | ||
604 | 604 | ||
605 | *err = 0; | 605 | *err = 0; |
606 | *new = 0; | 606 | *new = 0; |
@@ -676,11 +676,10 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, | |||
676 | return newblock; | 676 | return newblock; |
677 | } | 677 | } |
678 | 678 | ||
679 | last_block = block; | ||
680 | /* Are we beyond EOF? */ | 679 | /* Are we beyond EOF? */ |
681 | if (etype == -1) { | 680 | if (etype == -1) { |
682 | int ret; | 681 | int ret; |
683 | 682 | isBeyondEOF = 1; | |
684 | if (count) { | 683 | if (count) { |
685 | if (c) | 684 | if (c) |
686 | laarr[0] = laarr[1]; | 685 | laarr[0] = laarr[1]; |
@@ -718,11 +717,11 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, | |||
718 | memset(&laarr[c].extLocation, 0x00, | 717 | memset(&laarr[c].extLocation, 0x00, |
719 | sizeof(struct kernel_lb_addr)); | 718 | sizeof(struct kernel_lb_addr)); |
720 | count++; | 719 | count++; |
721 | endnum++; | ||
722 | } | 720 | } |
723 | endnum = c + 1; | 721 | endnum = c + 1; |
724 | lastblock = 1; | 722 | lastblock = 1; |
725 | } else { | 723 | } else { |
724 | isBeyondEOF = 0; | ||
726 | endnum = startnum = ((count > 2) ? 2 : count); | 725 | endnum = startnum = ((count > 2) ? 2 : count); |
727 | 726 | ||
728 | /* if the current extent is in position 0, | 727 | /* if the current extent is in position 0, |
@@ -765,10 +764,13 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, | |||
765 | goal, err); | 764 | goal, err); |
766 | if (!newblocknum) { | 765 | if (!newblocknum) { |
767 | brelse(prev_epos.bh); | 766 | brelse(prev_epos.bh); |
767 | brelse(cur_epos.bh); | ||
768 | brelse(next_epos.bh); | ||
768 | *err = -ENOSPC; | 769 | *err = -ENOSPC; |
769 | return 0; | 770 | return 0; |
770 | } | 771 | } |
771 | iinfo->i_lenExtents += inode->i_sb->s_blocksize; | 772 | if (isBeyondEOF) |
773 | iinfo->i_lenExtents += inode->i_sb->s_blocksize; | ||
772 | } | 774 | } |
773 | 775 | ||
774 | /* if the extent the requsted block is located in contains multiple | 776 | /* if the extent the requsted block is located in contains multiple |
@@ -795,6 +797,8 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, | |||
795 | udf_update_extents(inode, laarr, startnum, endnum, &prev_epos); | 797 | udf_update_extents(inode, laarr, startnum, endnum, &prev_epos); |
796 | 798 | ||
797 | brelse(prev_epos.bh); | 799 | brelse(prev_epos.bh); |
800 | brelse(cur_epos.bh); | ||
801 | brelse(next_epos.bh); | ||
798 | 802 | ||
799 | newblock = udf_get_pblock(inode->i_sb, newblocknum, | 803 | newblock = udf_get_pblock(inode->i_sb, newblocknum, |
800 | iinfo->i_location.partitionReferenceNum, 0); | 804 | iinfo->i_location.partitionReferenceNum, 0); |