* [Cluster-devel] GFS2: Pre-pull patch posting
@ 2010-03-11 17:21 Steven Whitehouse
2010-03-11 17:21 ` [Cluster-devel] [PATCH 1/3] GFS2: do not select QUOTA Steven Whitehouse
0 siblings, 1 reply; 4+ messages in thread
From: Steven Whitehouse @ 2010-03-11 17:21 UTC (permalink / raw)
To: cluster-devel.redhat.com
Here are three small (but important!) fixes to GFS2.
Steve.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 1/3] GFS2: do not select QUOTA
2010-03-11 17:21 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
@ 2010-03-11 17:21 ` Steven Whitehouse
2010-03-11 17:22 ` [Cluster-devel] [PATCH 2/3] GFS2: Allow the number of committed revokes to temporarily be negative Steven Whitehouse
0 siblings, 1 reply; 4+ messages in thread
From: Steven Whitehouse @ 2010-03-11 17:21 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Christoph Hellwig <hch@infradead.org>
gfs2 only needs the quotactl code, not the generic quota implementation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
fs/gfs2/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig
index 4dcddf8..a47b431 100644
--- a/fs/gfs2/Kconfig
+++ b/fs/gfs2/Kconfig
@@ -8,7 +8,6 @@ config GFS2_FS
select FS_POSIX_ACL
select CRC32
select SLOW_WORK
- select QUOTA
select QUOTACTL
help
A cluster filesystem.
--
1.6.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 2/3] GFS2: Allow the number of committed revokes to temporarily be negative
2010-03-11 17:21 ` [Cluster-devel] [PATCH 1/3] GFS2: do not select QUOTA Steven Whitehouse
@ 2010-03-11 17:22 ` Steven Whitehouse
2010-03-11 17:22 ` [Cluster-devel] [PATCH 3/3] GFS2: Skip check for mandatory locks when unlocking Steven Whitehouse
0 siblings, 1 reply; 4+ messages in thread
From: Steven Whitehouse @ 2010-03-11 17:22 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Benjamin Marzinski <bmarzins@redhat.com>
GFS2 tracks the number of revokes and unrevokes that are part of committed
transactions via sd_log_commited_revoke. It is possible for one process to add
revokes during its transaction, while another process unrevokes them during its
transaction. If the second process finishes its transaction first,
sd_log_commited_revoke will be decremented by the number of unrevokes that the
second process did, without first being incremented by the number of revokes
the first process did. This is fine, since all started transactions must be
completed before the journal can be flushed. However, sd_log_commited_revoke
is an unsigned integer, and log_refund() causes an assertion failure if it
would go negative at the end of a transaction. This patch makes
sd_log_commited_revoke a signed integer and allows it to go negative.
__gfs2_log_flush() still checks that it mataches the actual number of revokes.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
fs/gfs2/incore.h | 2 +-
fs/gfs2/log.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index b8025e5..3aac46f 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -616,7 +616,7 @@ struct gfs2_sbd {
unsigned int sd_log_blks_reserved;
unsigned int sd_log_commited_buf;
unsigned int sd_log_commited_databuf;
- unsigned int sd_log_commited_revoke;
+ int sd_log_commited_revoke;
unsigned int sd_log_num_buf;
unsigned int sd_log_num_revoke;
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 4511b08..e5bf4b5 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -417,7 +417,7 @@ static unsigned int calc_reserved(struct gfs2_sbd *sdp)
databufhdrs_needed = (sdp->sd_log_commited_databuf +
(dbuf_limit - 1)) / dbuf_limit;
- if (sdp->sd_log_commited_revoke)
+ if (sdp->sd_log_commited_revoke > 0)
revokes = gfs2_struct2blk(sdp, sdp->sd_log_commited_revoke,
sizeof(u64));
@@ -790,7 +790,6 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
gfs2_assert_withdraw(sdp, (((int)sdp->sd_log_commited_buf) >= 0) ||
(((int)sdp->sd_log_commited_databuf) >= 0));
sdp->sd_log_commited_revoke += tr->tr_num_revoke - tr->tr_num_revoke_rm;
- gfs2_assert_withdraw(sdp, ((int)sdp->sd_log_commited_revoke) >= 0);
reserved = calc_reserved(sdp);
gfs2_assert_withdraw(sdp, sdp->sd_log_blks_reserved + tr->tr_reserved >= reserved);
unused = sdp->sd_log_blks_reserved - reserved + tr->tr_reserved;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 3/3] GFS2: Skip check for mandatory locks when unlocking
2010-03-11 17:22 ` [Cluster-devel] [PATCH 2/3] GFS2: Allow the number of committed revokes to temporarily be negative Steven Whitehouse
@ 2010-03-11 17:22 ` Steven Whitehouse
0 siblings, 0 replies; 4+ messages in thread
From: Steven Whitehouse @ 2010-03-11 17:22 UTC (permalink / raw)
To: cluster-devel.redhat.com
From: Sachin Prabhu <sprabhu@redhat.com>
gfs2_lock() will skip locks on file which have mode set to 02666. This is a problem in cases where the mode of the file is changed after a process has obtained a lock on the file. Such a lock will be skipped and will result in a BUG in locks_remove_flock().
gfs2_lock() should skip the check for mandatory locks when unlocking a file.
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
fs/gfs2/file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index a6abbae..e6dd2ae 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -640,7 +640,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
if (!(fl->fl_flags & FL_POSIX))
return -ENOLCK;
- if (__mandatory_lock(&ip->i_inode))
+ if (__mandatory_lock(&ip->i_inode) && fl->fl_type != F_UNLCK)
return -ENOLCK;
if (cmd == F_CANCELLK) {
--
1.6.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-11 17:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 17:21 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
2010-03-11 17:21 ` [Cluster-devel] [PATCH 1/3] GFS2: do not select QUOTA Steven Whitehouse
2010-03-11 17:22 ` [Cluster-devel] [PATCH 2/3] GFS2: Allow the number of committed revokes to temporarily be negative Steven Whitehouse
2010-03-11 17:22 ` [Cluster-devel] [PATCH 3/3] GFS2: Skip check for mandatory locks when unlocking Steven Whitehouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).