Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+41 -13
+2 -5
fs/gfs2/Kconfig
··· 1 1 config GFS2_FS 2 2 tristate "GFS2 file system support" 3 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 4 select FS_POSIX_ACL 9 5 select CRC32 10 6 select QUOTACTL ··· 25 29 26 30 config GFS2_FS_LOCKING_DLM 27 31 bool "GFS2 DLM locking" 28 - depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && HOTPLUG 32 + depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && \ 33 + HOTPLUG && DLM && CONFIGFS_FS && SYSFS 29 34 help 30 35 Multiple node locking module for GFS2 31 36
+2 -2
fs/gfs2/aops.c
··· 807 807 808 808 if (inode == sdp->sd_rindex) { 809 809 adjust_fs_space(inode); 810 - ip->i_gh.gh_flags |= GL_NOCACHE; 810 + sdp->sd_rindex_uptodate = 0; 811 811 } 812 812 813 813 brelse(dibh); ··· 873 873 874 874 if (inode == sdp->sd_rindex) { 875 875 adjust_fs_space(inode); 876 - ip->i_gh.gh_flags |= GL_NOCACHE; 876 + sdp->sd_rindex_uptodate = 0; 877 877 } 878 878 879 879 brelse(dibh);
+5 -1
fs/gfs2/bmap.c
··· 724 724 int metadata; 725 725 unsigned int revokes = 0; 726 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 733 if (!*top) 730 734 sm->sm_first = 0;
+4
fs/gfs2/dir.c
··· 1844 1844 unsigned int x, size = len * sizeof(u64); 1845 1845 int error; 1846 1846 1847 + error = gfs2_rindex_update(sdp); 1848 + if (error) 1849 + return error; 1850 + 1847 1851 memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); 1848 1852 1849 1853 ht = kzalloc(size, GFP_NOFS);
+11 -2
fs/gfs2/inode.c
··· 1031 1031 struct buffer_head *bh; 1032 1032 struct gfs2_holder ghs[3]; 1033 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 1042 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); 1037 1043 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); ··· 1230 1224 return 0; 1231 1225 } 1232 1226 1227 + error = gfs2_rindex_update(sdp); 1228 + if (error) 1229 + return error; 1230 + 1233 1231 if (odip != ndip) { 1234 1232 error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, 1235 1233 0, &r_gh); ··· 1355 1345 error = alloc_required; 1356 1346 if (error < 0) 1357 1347 goto out_gunlock; 1358 - error = 0; 1359 1348 1360 1349 if (alloc_required) { 1361 1350 struct gfs2_qadata *qa = gfs2_qadata_get(ndip);
+5 -3
fs/gfs2/rgrp.c
··· 332 332 struct rb_node *n, *next; 333 333 struct gfs2_rgrpd *cur; 334 334 335 - if (gfs2_rindex_update(sdp)) 336 - return NULL; 337 - 338 335 spin_lock(&sdp->sd_rindex_spin); 339 336 n = sdp->sd_rindex_tree.rb_node; 340 337 while (n) { ··· 637 640 return 0; 638 641 639 642 error = 0; /* someone else read in the rgrp; free it and ignore it */ 643 + gfs2_glock_put(rgd->rd_gl); 640 644 641 645 fail: 642 646 kfree(rgd->rd_bits); ··· 924 926 r.minlen = 0; 925 927 } else if (copy_from_user(&r, argp, sizeof(r))) 926 928 return -EFAULT; 929 + 930 + ret = gfs2_rindex_update(sdp); 931 + if (ret) 932 + return ret; 927 933 928 934 rgd = gfs2_blk2rgrpd(sdp, r.start, 0); 929 935 rgd_end = gfs2_blk2rgrpd(sdp, r.start + r.len, 0);
+12
fs/gfs2/xattr.c
··· 238 238 unsigned int x; 239 239 int error; 240 240 241 + error = gfs2_rindex_update(sdp); 242 + if (error) 243 + return error; 244 + 241 245 if (GFS2_EA_IS_STUFFED(ea)) 242 246 return 0; 243 247 ··· 1334 1330 unsigned int x; 1335 1331 int error; 1336 1332 1333 + error = gfs2_rindex_update(sdp); 1334 + if (error) 1335 + return error; 1336 + 1337 1337 memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); 1338 1338 1339 1339 error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT, &indbh); ··· 1446 1438 struct buffer_head *dibh; 1447 1439 struct gfs2_holder gh; 1448 1440 int error; 1441 + 1442 + error = gfs2_rindex_update(sdp); 1443 + if (error) 1444 + return error; 1449 1445 1450 1446 rgd = gfs2_blk2rgrpd(sdp, ip->i_eattr, 1); 1451 1447 if (!rgd) {