Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'v6.15-rc8-ksmbd-server-fixes' of git://git.samba.org/ksmbd

Pull smb server fixes from Steve French:

- Fix for rename regression due to the recent VFS lookup changes

- Fix write failure

- locking fix for oplock handling

* tag 'v6.15-rc8-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
ksmbd: use list_first_entry_or_null for opinfo_get_list()
ksmbd: fix rename failure
ksmbd: fix stream write failure

+9 -14
+2 -5
fs/smb/server/oplock.c
··· 146 146 { 147 147 struct oplock_info *opinfo; 148 148 149 - if (list_empty(&ci->m_op_list)) 150 - return NULL; 151 - 152 149 down_read(&ci->m_lock); 153 - opinfo = list_first_entry(&ci->m_op_list, struct oplock_info, 154 - op_entry); 150 + opinfo = list_first_entry_or_null(&ci->m_op_list, struct oplock_info, 151 + op_entry); 155 152 if (opinfo) { 156 153 if (opinfo->conn == NULL || 157 154 !atomic_inc_not_zero(&opinfo->refcount))
+7 -9
fs/smb/server/vfs.c
··· 409 409 ksmbd_debug(VFS, "write stream data pos : %llu, count : %zd\n", 410 410 *pos, count); 411 411 412 + if (*pos >= XATTR_SIZE_MAX) { 413 + pr_err("stream write position %lld is out of bounds\n", *pos); 414 + return -EINVAL; 415 + } 416 + 412 417 size = *pos + count; 413 418 if (size > XATTR_SIZE_MAX) { 414 419 size = XATTR_SIZE_MAX; 415 - count = (*pos + count) - XATTR_SIZE_MAX; 420 + count = XATTR_SIZE_MAX - *pos; 416 421 } 417 422 418 423 v_len = ksmbd_vfs_getcasexattr(idmap, ··· 428 423 if (v_len < 0) { 429 424 pr_err("not found stream in xattr : %zd\n", v_len); 430 425 err = v_len; 431 - goto out; 432 - } 433 - 434 - if (v_len <= *pos) { 435 - pr_err("stream write position %lld is out of bounds (stream length: %zd)\n", 436 - *pos, v_len); 437 - err = -EINVAL; 438 426 goto out; 439 427 } 440 428 ··· 682 684 struct ksmbd_file *parent_fp; 683 685 int new_type; 684 686 int err, lookup_flags = LOOKUP_NO_SYMLINKS; 685 - int target_lookup_flags = LOOKUP_RENAME_TARGET; 687 + int target_lookup_flags = LOOKUP_RENAME_TARGET | LOOKUP_CREATE; 686 688 687 689 if (ksmbd_override_fsids(work)) 688 690 return -ENOMEM;