aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/Kconfig7
-rw-r--r--fs/gfs2/aops.c4
-rw-r--r--fs/gfs2/bmap.c6
-rw-r--r--fs/gfs2/dir.c4
-rw-r--r--fs/gfs2/inode.c13
-rw-r--r--fs/gfs2/rgrp.c8
-rw-r--r--fs/gfs2/xattr.c12
7 files changed, 41 insertions, 13 deletions
diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig
index c465ae066c6..eb08c9e43c2 100644
--- a/fs/gfs2/Kconfig
+++ b/fs/gfs2/Kconfig
@@ -1,10 +1,6 @@
1config GFS2_FS 1config 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
30config GFS2_FS_LOCKING_DLM 26config 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 38b7a74a0f9..9b2ff0e851b 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 197c5c47e57..03c04febe26 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 c35573abd37..a836056343f 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 c98a60ee6df..a9ba2444e07 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 19bde40b486..3df65c9ab73 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
644fail: 642fail:
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 2e5ba425cae..927f4df874a 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);