Skip to content

Commit

Permalink
GFS2: Add proper error reporting to quota sync via sysfs
Browse files Browse the repository at this point in the history
For some reason, the errors were not making it to userspace.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Dec 3, 2009
1 parent 1d371b5 commit ea76233
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fs/gfs2/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,29 +178,31 @@ static ssize_t quota_sync_store(struct gfs2_sbd *sdp, const char *buf,
static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf,
size_t len)
{
int error;
u32 id;

if (!capable(CAP_SYS_ADMIN))
return -EACCES;

id = simple_strtoul(buf, NULL, 0);

gfs2_quota_refresh(sdp, 1, id);
return len;
error = gfs2_quota_refresh(sdp, 1, id);
return error ? error : len;
}

static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf,
size_t len)
{
int error;
u32 id;

if (!capable(CAP_SYS_ADMIN))
return -EACCES;

id = simple_strtoul(buf, NULL, 0);

gfs2_quota_refresh(sdp, 0, id);
return len;
error = gfs2_quota_refresh(sdp, 0, id);
return error ? error : len;
}

static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
Expand Down

0 comments on commit ea76233

Please sign in to comment.