diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-11 14:04:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-11 14:04:45 -0400 |
commit | 1b6150fe82de8a555b0200d20bb5e3752fbe4160 (patch) | |
tree | d03b71e1b87b60d1a9dfbade34156e930f1be1bd /fs/gfs2 | |
parent | 92ae03f2ef99fbc23bfa9080d6b58f25227bd7ef (diff) | |
parent | ca9248d8337d525c2d2b26a1d8314478d15707fb (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes
Pull GFS2 fixes from Steven Whitehouse
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes:
GFS2: Allow caching of rindex glock
GFS2: Make sure rindex is uptodate before starting transactions
GFS2: use depends instead of select in kconfig
GFS2: put glock reference in error patch of read_rindex_entry
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/Kconfig | 7 | ||||
-rw-r--r-- | fs/gfs2/aops.c | 4 | ||||
-rw-r--r-- | fs/gfs2/bmap.c | 6 | ||||
-rw-r--r-- | fs/gfs2/dir.c | 4 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 13 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 8 | ||||
-rw-r--r-- | fs/gfs2/xattr.c | 12 |
7 files changed, 41 insertions, 13 deletions
diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig index c465ae066c62..eb08c9e43c2a 100644 --- a/fs/gfs2/Kconfig +++ b/fs/gfs2/Kconfig | |||
@@ -1,10 +1,6 @@ | |||
1 | config GFS2_FS | 1 | config GFS2_FS |
2 | tristate "GFS2 file system support" | 2 | tristate "GFS2 file system support" |
3 | depends on (64BIT || LBDAF) | 3 | depends on (64BIT || LBDAF) |
4 | select DLM if GFS2_FS_LOCKING_DLM | ||
5 | select CONFIGFS_FS if GFS2_FS_LOCKING_DLM | ||
6 | select SYSFS if GFS2_FS_LOCKING_DLM | ||
7 | select IP_SCTP if DLM_SCTP | ||
8 | select FS_POSIX_ACL | 4 | select FS_POSIX_ACL |
9 | select CRC32 | 5 | select CRC32 |
10 | select QUOTACTL | 6 | select QUOTACTL |
@@ -29,7 +25,8 @@ config GFS2_FS | |||
29 | 25 | ||
30 | config GFS2_FS_LOCKING_DLM | 26 | config GFS2_FS_LOCKING_DLM |
31 | bool "GFS2 DLM locking" | 27 | bool "GFS2 DLM locking" |
32 | depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && HOTPLUG | 28 | depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && \ |
29 | HOTPLUG && DLM && CONFIGFS_FS && SYSFS | ||
33 | help | 30 | help |
34 | Multiple node locking module for GFS2 | 31 | Multiple node locking module for GFS2 |
35 | 32 | ||
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 38b7a74a0f91..9b2ff0e851b1 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c | |||
@@ -807,7 +807,7 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh, | |||
807 | 807 | ||
808 | if (inode == sdp->sd_rindex) { | 808 | if (inode == sdp->sd_rindex) { |
809 | adjust_fs_space(inode); | 809 | adjust_fs_space(inode); |
810 | ip->i_gh.gh_flags |= GL_NOCACHE; | 810 | sdp->sd_rindex_uptodate = 0; |
811 | } | 811 | } |
812 | 812 | ||
813 | brelse(dibh); | 813 | brelse(dibh); |
@@ -873,7 +873,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping, | |||
873 | 873 | ||
874 | if (inode == sdp->sd_rindex) { | 874 | if (inode == sdp->sd_rindex) { |
875 | adjust_fs_space(inode); | 875 | adjust_fs_space(inode); |
876 | ip->i_gh.gh_flags |= GL_NOCACHE; | 876 | sdp->sd_rindex_uptodate = 0; |
877 | } | 877 | } |
878 | 878 | ||
879 | brelse(dibh); | 879 | brelse(dibh); |
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 197c5c47e577..03c04febe26f 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -724,7 +724,11 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
724 | int metadata; | 724 | int metadata; |
725 | unsigned int revokes = 0; | 725 | unsigned int revokes = 0; |
726 | int x; | 726 | int x; |
727 | int error = 0; | 727 | int error; |
728 | |||
729 | error = gfs2_rindex_update(sdp); | ||
730 | if (error) | ||
731 | return error; | ||
728 | 732 | ||
729 | if (!*top) | 733 | if (!*top) |
730 | sm->sm_first = 0; | 734 | sm->sm_first = 0; |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index c35573abd371..a836056343f0 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -1844,6 +1844,10 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, | |||
1844 | unsigned int x, size = len * sizeof(u64); | 1844 | unsigned int x, size = len * sizeof(u64); |
1845 | int error; | 1845 | int error; |
1846 | 1846 | ||
1847 | error = gfs2_rindex_update(sdp); | ||
1848 | if (error) | ||
1849 | return error; | ||
1850 | |||
1847 | memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); | 1851 | memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); |
1848 | 1852 | ||
1849 | ht = kzalloc(size, GFP_NOFS); | 1853 | ht = kzalloc(size, GFP_NOFS); |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index c98a60ee6dfd..a9ba2444e077 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -1031,7 +1031,13 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry) | |||
1031 | struct buffer_head *bh; | 1031 | struct buffer_head *bh; |
1032 | struct gfs2_holder ghs[3]; | 1032 | struct gfs2_holder ghs[3]; |
1033 | struct gfs2_rgrpd *rgd; | 1033 | struct gfs2_rgrpd *rgd; |
1034 | int error = -EROFS; | 1034 | int error; |
1035 | |||
1036 | error = gfs2_rindex_update(sdp); | ||
1037 | if (error) | ||
1038 | return error; | ||
1039 | |||
1040 | error = -EROFS; | ||
1035 | 1041 | ||
1036 | gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); | 1042 | gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); |
1037 | gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); | 1043 | gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); |
@@ -1224,6 +1230,10 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
1224 | return 0; | 1230 | return 0; |
1225 | } | 1231 | } |
1226 | 1232 | ||
1233 | error = gfs2_rindex_update(sdp); | ||
1234 | if (error) | ||
1235 | return error; | ||
1236 | |||
1227 | if (odip != ndip) { | 1237 | if (odip != ndip) { |
1228 | error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, | 1238 | error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, |
1229 | 0, &r_gh); | 1239 | 0, &r_gh); |
@@ -1345,7 +1355,6 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
1345 | error = alloc_required; | 1355 | error = alloc_required; |
1346 | if (error < 0) | 1356 | if (error < 0) |
1347 | goto out_gunlock; | 1357 | goto out_gunlock; |
1348 | error = 0; | ||
1349 | 1358 | ||
1350 | if (alloc_required) { | 1359 | if (alloc_required) { |
1351 | struct gfs2_qadata *qa = gfs2_qadata_get(ndip); | 1360 | struct gfs2_qadata *qa = gfs2_qadata_get(ndip); |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 19bde40b4864..3df65c9ab73b 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -332,9 +332,6 @@ struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk, bool exact) | |||
332 | struct rb_node *n, *next; | 332 | struct rb_node *n, *next; |
333 | struct gfs2_rgrpd *cur; | 333 | struct gfs2_rgrpd *cur; |
334 | 334 | ||
335 | if (gfs2_rindex_update(sdp)) | ||
336 | return NULL; | ||
337 | |||
338 | spin_lock(&sdp->sd_rindex_spin); | 335 | spin_lock(&sdp->sd_rindex_spin); |
339 | n = sdp->sd_rindex_tree.rb_node; | 336 | n = sdp->sd_rindex_tree.rb_node; |
340 | while (n) { | 337 | while (n) { |
@@ -640,6 +637,7 @@ static int read_rindex_entry(struct gfs2_inode *ip, | |||
640 | return 0; | 637 | return 0; |
641 | 638 | ||
642 | error = 0; /* someone else read in the rgrp; free it and ignore it */ | 639 | error = 0; /* someone else read in the rgrp; free it and ignore it */ |
640 | gfs2_glock_put(rgd->rd_gl); | ||
643 | 641 | ||
644 | fail: | 642 | fail: |
645 | kfree(rgd->rd_bits); | 643 | kfree(rgd->rd_bits); |
@@ -927,6 +925,10 @@ int gfs2_fitrim(struct file *filp, void __user *argp) | |||
927 | } else if (copy_from_user(&r, argp, sizeof(r))) | 925 | } else if (copy_from_user(&r, argp, sizeof(r))) |
928 | return -EFAULT; | 926 | return -EFAULT; |
929 | 927 | ||
928 | ret = gfs2_rindex_update(sdp); | ||
929 | if (ret) | ||
930 | return ret; | ||
931 | |||
930 | rgd = gfs2_blk2rgrpd(sdp, r.start, 0); | 932 | rgd = gfs2_blk2rgrpd(sdp, r.start, 0); |
931 | rgd_end = gfs2_blk2rgrpd(sdp, r.start + r.len, 0); | 933 | rgd_end = gfs2_blk2rgrpd(sdp, r.start + r.len, 0); |
932 | 934 | ||
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 2e5ba425cae7..927f4df874ae 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c | |||
@@ -238,6 +238,10 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, | |||
238 | unsigned int x; | 238 | unsigned int x; |
239 | int error; | 239 | int error; |
240 | 240 | ||
241 | error = gfs2_rindex_update(sdp); | ||
242 | if (error) | ||
243 | return error; | ||
244 | |||
241 | if (GFS2_EA_IS_STUFFED(ea)) | 245 | if (GFS2_EA_IS_STUFFED(ea)) |
242 | return 0; | 246 | return 0; |
243 | 247 | ||
@@ -1330,6 +1334,10 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) | |||
1330 | unsigned int x; | 1334 | unsigned int x; |
1331 | int error; | 1335 | int error; |
1332 | 1336 | ||
1337 | error = gfs2_rindex_update(sdp); | ||
1338 | if (error) | ||
1339 | return error; | ||
1340 | |||
1333 | memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); | 1341 | memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); |
1334 | 1342 | ||
1335 | error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT, &indbh); | 1343 | error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT, &indbh); |
@@ -1439,6 +1447,10 @@ static int ea_dealloc_block(struct gfs2_inode *ip) | |||
1439 | struct gfs2_holder gh; | 1447 | struct gfs2_holder gh; |
1440 | int error; | 1448 | int error; |
1441 | 1449 | ||
1450 | error = gfs2_rindex_update(sdp); | ||
1451 | if (error) | ||
1452 | return error; | ||
1453 | |||
1442 | rgd = gfs2_blk2rgrpd(sdp, ip->i_eattr, 1); | 1454 | rgd = gfs2_blk2rgrpd(sdp, ip->i_eattr, 1); |
1443 | if (!rgd) { | 1455 | if (!rgd) { |
1444 | gfs2_consist_inode(ip); | 1456 | gfs2_consist_inode(ip); |