diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 9793ae0bcaa2..d4890b6dc22d 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1112,6 +1112,12 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
1112 | return rc; | 1112 | return rc; |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | static __u32 | ||
1116 | hash_lockowner(fl_owner_t owner) | ||
1117 | { | ||
1118 | return cifs_lock_secret ^ hash32_ptr((const void *)owner); | ||
1119 | } | ||
1120 | |||
1115 | struct lock_to_push { | 1121 | struct lock_to_push { |
1116 | struct list_head llist; | 1122 | struct list_head llist; |
1117 | __u64 offset; | 1123 | __u64 offset; |
@@ -1178,7 +1184,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile) | |||
1178 | else | 1184 | else |
1179 | type = CIFS_WRLCK; | 1185 | type = CIFS_WRLCK; |
1180 | lck = list_entry(el, struct lock_to_push, llist); | 1186 | lck = list_entry(el, struct lock_to_push, llist); |
1181 | lck->pid = flock->fl_pid; | 1187 | lck->pid = hash_lockowner(flock->fl_owner); |
1182 | lck->netfid = cfile->fid.netfid; | 1188 | lck->netfid = cfile->fid.netfid; |
1183 | lck->length = length; | 1189 | lck->length = length; |
1184 | lck->type = type; | 1190 | lck->type = type; |
@@ -1305,7 +1311,8 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, | |||
1305 | posix_lock_type = CIFS_RDLCK; | 1311 | posix_lock_type = CIFS_RDLCK; |
1306 | else | 1312 | else |
1307 | posix_lock_type = CIFS_WRLCK; | 1313 | posix_lock_type = CIFS_WRLCK; |
1308 | rc = CIFSSMBPosixLock(xid, tcon, netfid, current->tgid, | 1314 | rc = CIFSSMBPosixLock(xid, tcon, netfid, |
1315 | hash_lockowner(flock->fl_owner), | ||
1309 | flock->fl_start, length, flock, | 1316 | flock->fl_start, length, flock, |
1310 | posix_lock_type, wait_flag); | 1317 | posix_lock_type, wait_flag); |
1311 | return rc; | 1318 | return rc; |
@@ -1505,7 +1512,8 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, | |||
1505 | posix_lock_type = CIFS_UNLCK; | 1512 | posix_lock_type = CIFS_UNLCK; |
1506 | 1513 | ||
1507 | rc = CIFSSMBPosixLock(xid, tcon, cfile->fid.netfid, | 1514 | rc = CIFSSMBPosixLock(xid, tcon, cfile->fid.netfid, |
1508 | current->tgid, flock->fl_start, length, | 1515 | hash_lockowner(flock->fl_owner), |
1516 | flock->fl_start, length, | ||
1509 | NULL, posix_lock_type, wait_flag); | 1517 | NULL, posix_lock_type, wait_flag); |
1510 | goto out; | 1518 | goto out; |
1511 | } | 1519 | } |