diff options
Diffstat (limited to 'fs/gfs2/sys.c')
| -rw-r--r-- | fs/gfs2/sys.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 446329728d52..0dc34621f6a6 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
| @@ -85,11 +85,7 @@ static ssize_t uuid_show(struct gfs2_sbd *sdp, char *buf) | |||
| 85 | buf[0] = '\0'; | 85 | buf[0] = '\0'; |
| 86 | if (!gfs2_uuid_valid(uuid)) | 86 | if (!gfs2_uuid_valid(uuid)) |
| 87 | return 0; | 87 | return 0; |
| 88 | return snprintf(buf, PAGE_SIZE, "%02X%02X%02X%02X-%02X%02X-" | 88 | return snprintf(buf, PAGE_SIZE, "%pUB\n", uuid); |
| 89 | "%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X\n", | ||
| 90 | uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], | ||
| 91 | uuid[6], uuid[7], uuid[8], uuid[9], uuid[10], uuid[11], | ||
| 92 | uuid[12], uuid[13], uuid[14], uuid[15]); | ||
| 93 | } | 89 | } |
| 94 | 90 | ||
| 95 | static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf) | 91 | static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf) |
| @@ -158,7 +154,7 @@ static ssize_t statfs_sync_store(struct gfs2_sbd *sdp, const char *buf, | |||
| 158 | if (simple_strtol(buf, NULL, 0) != 1) | 154 | if (simple_strtol(buf, NULL, 0) != 1) |
| 159 | return -EINVAL; | 155 | return -EINVAL; |
| 160 | 156 | ||
| 161 | gfs2_statfs_sync(sdp); | 157 | gfs2_statfs_sync(sdp->sd_vfs, 0); |
| 162 | return len; | 158 | return len; |
| 163 | } | 159 | } |
| 164 | 160 | ||
| @@ -171,13 +167,14 @@ static ssize_t quota_sync_store(struct gfs2_sbd *sdp, const char *buf, | |||
| 171 | if (simple_strtol(buf, NULL, 0) != 1) | 167 | if (simple_strtol(buf, NULL, 0) != 1) |
| 172 | return -EINVAL; | 168 | return -EINVAL; |
| 173 | 169 | ||
| 174 | gfs2_quota_sync(sdp); | 170 | gfs2_quota_sync(sdp->sd_vfs, 0); |
| 175 | return len; | 171 | return len; |
| 176 | } | 172 | } |
| 177 | 173 | ||
| 178 | static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf, | 174 | static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf, |
| 179 | size_t len) | 175 | size_t len) |
| 180 | { | 176 | { |
| 177 | int error; | ||
| 181 | u32 id; | 178 | u32 id; |
| 182 | 179 | ||
| 183 | if (!capable(CAP_SYS_ADMIN)) | 180 | if (!capable(CAP_SYS_ADMIN)) |
| @@ -185,13 +182,14 @@ static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf, | |||
| 185 | 182 | ||
| 186 | id = simple_strtoul(buf, NULL, 0); | 183 | id = simple_strtoul(buf, NULL, 0); |
| 187 | 184 | ||
| 188 | gfs2_quota_refresh(sdp, 1, id); | 185 | error = gfs2_quota_refresh(sdp, 1, id); |
| 189 | return len; | 186 | return error ? error : len; |
| 190 | } | 187 | } |
| 191 | 188 | ||
| 192 | static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf, | 189 | static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf, |
| 193 | size_t len) | 190 | size_t len) |
| 194 | { | 191 | { |
| 192 | int error; | ||
| 195 | u32 id; | 193 | u32 id; |
| 196 | 194 | ||
| 197 | if (!capable(CAP_SYS_ADMIN)) | 195 | if (!capable(CAP_SYS_ADMIN)) |
| @@ -199,8 +197,8 @@ static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf, | |||
| 199 | 197 | ||
| 200 | id = simple_strtoul(buf, NULL, 0); | 198 | id = simple_strtoul(buf, NULL, 0); |
| 201 | 199 | ||
| 202 | gfs2_quota_refresh(sdp, 0, id); | 200 | error = gfs2_quota_refresh(sdp, 0, id); |
| 203 | return len; | 201 | return error ? error : len; |
| 204 | } | 202 | } |
| 205 | 203 | ||
| 206 | static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len) | 204 | static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len) |
| @@ -573,14 +571,8 @@ static int gfs2_uevent(struct kset *kset, struct kobject *kobj, | |||
| 573 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); | 571 | add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); |
| 574 | if (!sdp->sd_args.ar_spectator) | 572 | if (!sdp->sd_args.ar_spectator) |
| 575 | add_uevent_var(env, "JOURNALID=%u", sdp->sd_lockstruct.ls_jid); | 573 | add_uevent_var(env, "JOURNALID=%u", sdp->sd_lockstruct.ls_jid); |
| 576 | if (gfs2_uuid_valid(uuid)) { | 574 | if (gfs2_uuid_valid(uuid)) |
| 577 | add_uevent_var(env, "UUID=%02X%02X%02X%02X-%02X%02X-%02X%02X-" | 575 | add_uevent_var(env, "UUID=%pUB", uuid); |
| 578 | "%02X%02X-%02X%02X%02X%02X%02X%02X", | ||
| 579 | uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], | ||
| 580 | uuid[5], uuid[6], uuid[7], uuid[8], uuid[9], | ||
| 581 | uuid[10], uuid[11], uuid[12], uuid[13], | ||
| 582 | uuid[14], uuid[15]); | ||
| 583 | } | ||
| 584 | return 0; | 576 | return 0; |
| 585 | } | 577 | } |
| 586 | 578 | ||
