Pull orangefs updates from Mike Marshall: "Fixes: - fix double-free of trailer_buf - skip leading spaces before parsing client debug masks Cleanup: - Remove commented out code New: - use folio_pos() and folio_size() in orangefs_page_mkwrite()" * tag 'for-linus-7.3-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: skip leading spaces before parsing client debug masks orangefs: Remove commented out code in find_cached_xattr orangefs: use folio_pos() and folio_size() in orangefs_page_mkwrite() orangefs: fix double-free of trailer_buf on readdir copy failure
Unified · Split
| @@ -474,6 +474,7 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb, · 473 unmodified lines | |||
| 474 | op->downcall.trailer_size, iter)) { | 474 | op->downcall.trailer_size, iter)) { |
| 475 | gossip_err("%s: failed to copy trailer.\n", __func__); | 475 | gossip_err("%s: failed to copy trailer.\n", __func__); |
| 476 | vfree(op->downcall.trailer_buf); | 476 | vfree(op->downcall.trailer_buf); |
| 477 | op->downcall.trailer_buf = NULL; | ||
| 477 | goto Efault; | 478 | goto Efault; |
| 478 | } | 479 | } |
| 479 | 480 | ||
| @@ -652,8 +652,8 @@ vm_fault_t orangefs_page_mkwrite(struct vm_fault *vmf) · 651 unmodified lines | |||
| 652 | wr = folio_get_private(folio); | 652 | wr = folio_get_private(folio); |
| 653 | if (uid_eq(wr->uid, current_fsuid()) && | 653 | if (uid_eq(wr->uid, current_fsuid()) && |
| 654 | gid_eq(wr->gid, current_fsgid())) { | 654 | gid_eq(wr->gid, current_fsgid())) { |
| 655 | wr->pos = page_offset(vmf->page); | 655 | wr->pos = folio_pos(folio); |
| 656 | wr->len = PAGE_SIZE; | 656 | wr->len = folio_size(folio); |
| 657 | goto okay; | 657 | goto okay; |
| 658 | } else { | 658 | } else { |
| 659 | if (orangefs_launder_folio(folio)) { | 659 | if (orangefs_launder_folio(folio)) { |
| @@ -667,8 +667,8 @@ vm_fault_t orangefs_page_mkwrite(struct vm_fault *vmf) · 7 unmodified lines | |||
| 667 | ret = VM_FAULT_LOCKED|VM_FAULT_RETRY; | 667 | ret = VM_FAULT_LOCKED|VM_FAULT_RETRY; |
| 668 | goto out; | 668 | goto out; |
| 669 | } | 669 | } |
| 670 | wr->pos = page_offset(vmf->page); | 670 | wr->pos = folio_pos(folio); |
| 671 | wr->len = PAGE_SIZE; | 671 | wr->len = folio_size(folio); |
| 672 | wr->uid = current_fsuid(); | 672 | wr->uid = current_fsuid(); |
| 673 | wr->gid = current_fsgid(); | 673 | wr->gid = current_fsgid(); |
| 674 | folio_attach_private(folio, wr); | 674 | folio_attach_private(folio, wr); |
| @@ -569,6 +569,7 @@ static int orangefs_prepare_cdm_array(char *debug_array_string) · 568 unmodified lines | |||
| 569 | cds_delimiter = strchr(cds_head, '\n'); | 569 | cds_delimiter = strchr(cds_head, '\n'); |
| 570 | *cds_delimiter = '\0'; | 570 | *cds_delimiter = '\0'; |
| 571 | 571 | ||
| 572 | cds_head = skip_spaces(cds_head); | ||
| 572 | keyword_len = strcspn(cds_head, " "); | 573 | keyword_len = strcspn(cds_head, " "); |
| 573 | 574 | ||
| 574 | cdm_array[i].keyword = kzalloc(keyword_len + 1, GFP_KERNEL); | 575 | cdm_array[i].keyword = kzalloc(keyword_len + 1, GFP_KERNEL); |
| @@ -72,11 +72,6 @@ static struct orangefs_cached_xattr *find_cached_xattr(struct inode *inode, · 71 unmodified lines | |||
| 72 | if (hlist_empty(h)) | 72 | if (hlist_empty(h)) |
| 73 | return NULL; | 73 | return NULL; |
| 74 | hlist_for_each_entry_safe(cx, tmp, h, node) { | 74 | hlist_for_each_entry_safe(cx, tmp, h, node) { |
| 75 | /* if (!time_before(jiffies, cx->timeout)) { | ||
| 76 | hlist_del(&cx->node); | ||
| 77 | kfree(cx); | ||
| 78 | continue; | ||
| 79 | }*/ | ||
| 80 | if (!strcmp(cx->key, key)) | 75 | if (!strcmp(cx->key, key)) |
| 81 | return cx; | 76 | return cx; |
| 82 | } | 77 | } |