aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/xattr.c
diff options
context:
space:
mode:
authorGeyslan G. Bem <geyslan@gmail.com>2013-10-21 15:47:58 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2013-11-23 17:10:31 -0500
commitbdd5c28dcb8330b9074404cc92a0b83aae5606a9 (patch)
treec9eb26cb19bcc7d04b0775a59e893b9046f199c5 /fs/9p/xattr.c
parent72fe18c9c71c1911b02d4765661ea1522053b5df (diff)
9p: fix return value in case in v9fs_fid_xattr_set()
In case of error in the p9_client_write, the function v9fs_fid_xattr_set should return its negative value, what was never being done. In case of success it only retuned 0. Now it returns the 'offset' variable (write_count total). Signed-off-by: Geyslan G. Bem <geyslan@gmail.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/xattr.c')
-rw-r--r--fs/9p/xattr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c
index 3c28cdfb8c47..04133a1fd9cb 100644
--- a/fs/9p/xattr.c
+++ b/fs/9p/xattr.c
@@ -138,8 +138,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name,
138 if (retval < 0) { 138 if (retval < 0) {
139 p9_debug(P9_DEBUG_VFS, "p9_client_xattrcreate failed %d\n", 139 p9_debug(P9_DEBUG_VFS, "p9_client_xattrcreate failed %d\n",
140 retval); 140 retval);
141 p9_client_clunk(fid); 141 goto err;
142 return retval;
143 } 142 }
144 msize = fid->clnt->msize; 143 msize = fid->clnt->msize;
145 while (value_len) { 144 while (value_len) {
@@ -152,12 +151,15 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name,
152 if (write_count < 0) { 151 if (write_count < 0) {
153 /* error in xattr write */ 152 /* error in xattr write */
154 retval = write_count; 153 retval = write_count;
155 break; 154 goto err;
156 } 155 }
157 offset += write_count; 156 offset += write_count;
158 value_len -= write_count; 157 value_len -= write_count;
159 } 158 }
160 return p9_client_clunk(fid); 159 retval = offset;
160err:
161 p9_client_clunk(fid);
162 return retval;
161} 163}
162 164
163ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) 165ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)