@@ -176,20 +176,23 @@ nlm_delete_file(struct nlm_file *file)
176
176
}
177
177
}
178
178
179
- static int nlm_unlock_files (struct nlm_file * file , fl_owner_t owner )
179
+ static int nlm_unlock_files (struct nlm_file * file , const struct file_lock * fl )
180
180
{
181
181
struct file_lock lock ;
182
182
183
183
locks_init_lock (& lock );
184
184
lock .fl_type = F_UNLCK ;
185
185
lock .fl_start = 0 ;
186
186
lock .fl_end = OFFSET_MAX ;
187
- lock .fl_owner = owner ;
188
- if (file -> f_file [O_RDONLY ] &&
189
- vfs_lock_file (file -> f_file [O_RDONLY ], F_SETLK , & lock , NULL ))
187
+ lock .fl_owner = fl -> fl_owner ;
188
+ lock .fl_pid = fl -> fl_pid ;
189
+ lock .fl_flags = FL_POSIX ;
190
+
191
+ lock .fl_file = file -> f_file [O_RDONLY ];
192
+ if (lock .fl_file && vfs_lock_file (lock .fl_file , F_SETLK , & lock , NULL ))
190
193
goto out_err ;
191
- if ( file -> f_file [O_WRONLY ] &&
192
- vfs_lock_file (file -> f_file [ O_WRONLY ] , F_SETLK , & lock , NULL ))
194
+ lock . fl_file = file -> f_file [O_WRONLY ];
195
+ if ( lock . fl_file && vfs_lock_file (lock . fl_file , F_SETLK , & lock , NULL ))
193
196
goto out_err ;
194
197
return 0 ;
195
198
out_err :
@@ -226,7 +229,7 @@ nlm_traverse_locks(struct nlm_host *host, struct nlm_file *file,
226
229
if (match (lockhost , host )) {
227
230
228
231
spin_unlock (& flctx -> flc_lock );
229
- if (nlm_unlock_files (file , fl -> fl_owner ))
232
+ if (nlm_unlock_files (file , fl ))
230
233
return 1 ;
231
234
goto again ;
232
235
}
0 commit comments