diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 15:39:53 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 15:39:53 -0400 |
| commit | f6f0a6d6a7258eff41fd202fc70df18271a2de79 (patch) | |
| tree | a32040d8cc6e06e056e184e35ed4729e28a244d8 /fs/gfs2/sys.c | |
| parent | 2017bd19454ea7cdae19922d15b6930f6c8088a2 (diff) | |
| parent | 33027af637da3f69bd17488cc3e68493c9052a7d (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (22 commits)
GFS2: fixed typo
GFS2: Fix type mapping for demote_rq interface
GFS2 fatal: filesystem consistency error on rename
GFS2: Improve journal allocation via sysfs
GFS2: Add "norecovery" mount option as a synonym for "spectator"
GFS2: Fix spectator umount issue
GFS2: Fix compiler warning from previous patch
GFS2: reserve more blocks for transactions
GFS2: Fix journal check for spectator mounts
GFS2: Remove upgrade mount option
GFS2: Remove localcaching mount option
GFS2: Remove ignore_local_fs mount argument
GFS2: Make . and .. qstrs constant
GFS2: Use new workqueue scheme
GFS2: Update handling of DLM return codes to match reality
GFS2: Don't enforce min hold time when two demotes occur in rapid succession
GFS2: Fix whitespace in previous patch
GFS2: fallocate support
GFS2: Add a bug trap in allocation code
GFS2: No longer experimental
...
Diffstat (limited to 'fs/gfs2/sys.c')
| -rw-r--r-- | fs/gfs2/sys.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index ccacffd2faaa..748ccb557c18 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
| @@ -230,7 +230,10 @@ static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len | |||
| 230 | 230 | ||
| 231 | if (gltype > LM_TYPE_JOURNAL) | 231 | if (gltype > LM_TYPE_JOURNAL) |
| 232 | return -EINVAL; | 232 | return -EINVAL; |
| 233 | glops = gfs2_glops_list[gltype]; | 233 | if (gltype == LM_TYPE_NONDISK && glnum == GFS2_TRANS_LOCK) |
| 234 | glops = &gfs2_trans_glops; | ||
| 235 | else | ||
| 236 | glops = gfs2_glops_list[gltype]; | ||
| 234 | if (glops == NULL) | 237 | if (glops == NULL) |
| 235 | return -EINVAL; | 238 | return -EINVAL; |
| 236 | if (!test_and_set_bit(SDF_DEMOTE, &sdp->sd_flags)) | 239 | if (!test_and_set_bit(SDF_DEMOTE, &sdp->sd_flags)) |
| @@ -399,31 +402,32 @@ static ssize_t recover_status_show(struct gfs2_sbd *sdp, char *buf) | |||
| 399 | 402 | ||
| 400 | static ssize_t jid_show(struct gfs2_sbd *sdp, char *buf) | 403 | static ssize_t jid_show(struct gfs2_sbd *sdp, char *buf) |
| 401 | { | 404 | { |
| 402 | return sprintf(buf, "%u\n", sdp->sd_lockstruct.ls_jid); | 405 | return sprintf(buf, "%d\n", sdp->sd_lockstruct.ls_jid); |
| 403 | } | 406 | } |
| 404 | 407 | ||
| 405 | static ssize_t jid_store(struct gfs2_sbd *sdp, const char *buf, size_t len) | 408 | static ssize_t jid_store(struct gfs2_sbd *sdp, const char *buf, size_t len) |
| 406 | { | 409 | { |
| 407 | unsigned jid; | 410 | int jid; |
| 408 | int rv; | 411 | int rv; |
| 409 | 412 | ||
| 410 | rv = sscanf(buf, "%u", &jid); | 413 | rv = sscanf(buf, "%d", &jid); |
| 411 | if (rv != 1) | 414 | if (rv != 1) |
| 412 | return -EINVAL; | 415 | return -EINVAL; |
| 413 | 416 | ||
| 414 | spin_lock(&sdp->sd_jindex_spin); | 417 | spin_lock(&sdp->sd_jindex_spin); |
| 415 | rv = -EINVAL; | 418 | rv = -EINVAL; |
| 416 | if (sdp->sd_args.ar_spectator) | ||
| 417 | goto out; | ||
| 418 | if (sdp->sd_lockstruct.ls_ops->lm_mount == NULL) | 419 | if (sdp->sd_lockstruct.ls_ops->lm_mount == NULL) |
| 419 | goto out; | 420 | goto out; |
| 420 | rv = -EBUSY; | 421 | rv = -EBUSY; |
| 421 | if (test_and_clear_bit(SDF_NOJOURNALID, &sdp->sd_flags) == 0) | 422 | if (test_bit(SDF_NOJOURNALID, &sdp->sd_flags) == 0) |
| 422 | goto out; | 423 | goto out; |
| 424 | rv = 0; | ||
| 425 | if (sdp->sd_args.ar_spectator && jid > 0) | ||
| 426 | rv = jid = -EINVAL; | ||
| 423 | sdp->sd_lockstruct.ls_jid = jid; | 427 | sdp->sd_lockstruct.ls_jid = jid; |
| 428 | clear_bit(SDF_NOJOURNALID, &sdp->sd_flags); | ||
| 424 | smp_mb__after_clear_bit(); | 429 | smp_mb__after_clear_bit(); |
| 425 | wake_up_bit(&sdp->sd_flags, SDF_NOJOURNALID); | 430 | wake_up_bit(&sdp->sd_flags, SDF_NOJOURNALID); |
| 426 | rv = 0; | ||
| 427 | out: | 431 | out: |
| 428 | spin_unlock(&sdp->sd_jindex_spin); | 432 | spin_unlock(&sdp->sd_jindex_spin); |
| 429 | return rv ? rv : len; | 433 | return rv ? rv : len; |
| @@ -617,7 +621,7 @@ static int gfs2_uevent(struct kset *kset, struct kobject *kobj, | |||
| 617 | add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name); | 621 | add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name); |
| 618 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); | 622 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); |
| 619 | if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) | 623 | if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) |
| 620 | add_uevent_var(env, "JOURNALID=%u", sdp->sd_lockstruct.ls_jid); | 624 | add_uevent_var(env, "JOURNALID=%d", sdp->sd_lockstruct.ls_jid); |
| 621 | if (gfs2_uuid_valid(uuid)) | 625 | if (gfs2_uuid_valid(uuid)) |
| 622 | add_uevent_var(env, "UUID=%pUB", uuid); | 626 | add_uevent_var(env, "UUID=%pUB", uuid); |
| 623 | return 0; | 627 | return 0; |
