aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/vfs_file.c')
-rw-r--r--fs/9p/vfs_file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 2a9dd37dc426..1ef16bd8280b 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -151,7 +151,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
151{ 151{
152 struct p9_flock flock; 152 struct p9_flock flock;
153 struct p9_fid *fid; 153 struct p9_fid *fid;
154 uint8_t status; 154 uint8_t status = P9_LOCK_ERROR;
155 int res = 0; 155 int res = 0;
156 unsigned char fl_type; 156 unsigned char fl_type;
157 157
@@ -196,7 +196,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
196 for (;;) { 196 for (;;) {
197 res = p9_client_lock_dotl(fid, &flock, &status); 197 res = p9_client_lock_dotl(fid, &flock, &status);
198 if (res < 0) 198 if (res < 0)
199 break; 199 goto out_unlock;
200 200
201 if (status != P9_LOCK_BLOCKED) 201 if (status != P9_LOCK_BLOCKED)
202 break; 202 break;
@@ -214,14 +214,16 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
214 case P9_LOCK_BLOCKED: 214 case P9_LOCK_BLOCKED:
215 res = -EAGAIN; 215 res = -EAGAIN;
216 break; 216 break;
217 default:
218 WARN_ONCE(1, "unknown lock status code: %d\n", status);
219 /* fallthough */
217 case P9_LOCK_ERROR: 220 case P9_LOCK_ERROR:
218 case P9_LOCK_GRACE: 221 case P9_LOCK_GRACE:
219 res = -ENOLCK; 222 res = -ENOLCK;
220 break; 223 break;
221 default:
222 BUG();
223 } 224 }
224 225
226out_unlock:
225 /* 227 /*
226 * incase server returned error for lock request, revert 228 * incase server returned error for lock request, revert
227 * it locally 229 * it locally