GFS2: Pre-pull patch posting (fixes)
This time there are just four fixes. There are a couple of minor updates to the quota code, a fix for KConfig to ensure that only valid combinations including GFS2 can be built, and a fix for a typo affecting end i/o processing when writing the journal.
Also, there is a temporary fix for a performance regression relating to block reservations and directories. A longer fix will be applied in due course, but this deals with the most immediate problem for now,
Steve.
PATCH 1/4 GFS2: two minor quota fixups
From: Bob Peterson <[email protected]>
This patch fixes two regression problems that Abhi found in the GFS2 quota code.
fs/gfs2/quota.c +2 -2
@@ -121,7 +121,7 @@ static u64 qd2index(struct gfs2_quota_data *qd) {struct kqid qid = qd->qd_id;return (2 * (u64 )from_kqid (&init_user_ns, qid)) + - (qid.type ==USRQUOTA ) ?0 :1 ; + ((qid.type ==USRQUOTA ) ?0 :1 ); }static u64 qd2offset (struct gfs2_quota_data *qd)
@@ -721,7 +721,7 @@ get_a_page: goto unlock_out; } -gfs2_trans_add_meta (ip->i_gl, bh); +gfs2_trans_add_data (ip->i_gl, bh); kaddr =kmap_atomic (page);if (offset +sizeof (struct gfs2_quota ) >PAGE_CACHE_SIZE )
Signature · 1 line
1.7.4
PATCH 2/4 GFS2: Use single-block reservations for directories
In reply to Steven WhitehouseFrom: Bob Peterson <[email protected]>
This patch changes the multi-block allocation code, such that directory inodes only get a single block reserved in the bitmap. That way, the bitmaps are more tightly packed together, and there are fewer spans of free blocks for in-use block reservations. This means it takes less time to find a free span of blocks in the bitmap, which speeds things up. This increases the performance of some workloads by almost 2X. In Nate's mockup.py script (which does
(1) create dir, (2) create dir in dir, (3) create file in that dir) the test executes in 23 steps rather than 43 steps, a 47% performance improvement.
fs/gfs2/rgrp.c +7 -2
@@ -1401,9 +1401,14 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip,u32 extlen;u32 free_blocks = rgd->rd_free_clone - rgd->rd_reserved;int ret; +struct inode *inode = &ip->i_inode; - extlen =max_t (u32,atomic_read (&rs->rs_sizehint), requested); - extlen =clamp (extlen,RGRP_RSRV_MINBLKS , free_blocks); +if (S_ISDIR (inode->i_mode)) + extlen =1 ; +else { + extlen =max_t (u32,atomic_read (&rs->rs_sizehint), requested); + extlen =clamp (extlen,RGRP_RSRV_MINBLKS , free_blocks); + }if ((rgd->rd_free_clone < rgd->rd_reserved) || (free_blocks < extlen))return ;
Signature · 1 line
1.7.4
PATCH 3/4 GFS2: fix DLM depends to fix build errors
In reply to Steven WhitehouseFrom: Randy Dunlap <[email protected]>
Fix build errors by correcting DLM dependencies in GFS2. Build errors happen when CONFIG_GFS2_FS_LOCKING_DLM=y and CONFIG_DLM=m:
fs/built-in.o: In function `gfs2_lock':
file.c:(.text+0xc7abd): undefined reference to dlm_posix_get' file.c:(.text+0xc7ad0): undefined reference to dlm_posix_unlock' file.c:(.text+0xc7ad9): undefined reference to dlm_posix_lock' fs/built-in.o: In function gdlm_unmount':
lock_dlm.c:(.text+0xd6e5b): undefined reference to dlm_release_lockspace' fs/built-in.o: In function sync_unlock':
lock_dlm.c:(.text+0xd6e9e): undefined reference to dlm_unlock' fs/built-in.o: In function sync_lock':
lock_dlm.c:(.text+0xd6fb6): undefined reference to dlm_lock' fs/built-in.o: In function gdlm_put_lock':
lock_dlm.c:(.text+0xd7238): undefined reference to dlm_unlock' fs/built-in.o: In function gdlm_mount':
lock_dlm.c:(.text+0xd753e): undefined reference to dlm_new_lockspace' lock_dlm.c:(.text+0xd79d3): undefined reference to dlm_release_lockspace' fs/built-in.o: In function `gdlm_lock':
lock_dlm.c:(.text+0xd8179): undefined reference to dlm_lock' fs/built-in.o: In function gdlm_cancel':
lock_dlm.c:(.text+0xd6b22): undefined reference to `dlm_unlock'
fs/gfs2/Kconfig +1 -1
@@ -26,7 +26,7 @@ config GFS2_FS config GFS2_FS_LOCKING_DLM bool "GFS2 DLM locking" depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && \ - HOTPLUG && DLM && CONFIGFS_FS && SYSFS + HOTPLUG && CONFIGFS_FS && SYSFS && (DLM=y || DLM=GFS2_FS) help Multiple node locking module for GFS2
Signature · 1 line
1.7.4
PATCH 4/4 GFS2: Fix typo in gfs2_log_end_write loop
In reply to Steven WhitehouseThere was a missing _all in this loop iterator
fs/gfs2/lops.c +1 -1
@@ -212,7 +212,7 @@ static void gfs2_end_log_write(struct bio *bio, int error)fs_err (sdp,"Error %d writing to log\n" , error); } -bio_for_each_segment (bvec, bio, i) { +bio_for_each_segment_all (bvec, bio, i) { page = bvec->bv_page;if (page_has_buffers (page))gfs2_end_log_write_bh (sdp, bvec, error);
Signature · 1 line
1.7.4