1. 18 5月, 2023 2 次提交
    • B
      SMB3: drop reference to cfile before sending oplock break · 59a556ae
      Bharath SM 提交于
      In cifs_oplock_break function we drop reference to a cfile at
      the end of function, due to which close command goes on wire
      after lease break acknowledgment even if file is already closed
      by application but we had deferred the handle close.
      If other client with limited file shareaccess waiting on lease
      break ack proceeds operation on that file as soon as first client
      sends ack, then we may encounter status sharing violation error
      because of open handle.
      Solution is to put reference to cfile(send close on wire if last ref)
      and then send oplock acknowledgment to server.
      
      Fixes: 9e31678f ("SMB3: fix lease break timeout when multiple deferred close handles for the same file.")
      Cc: stable@kernel.org
      Signed-off-by: NBharath SM <bharathsm@microsoft.com>
      Reviewed-by: NShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      59a556ae
    • B
      SMB3: Close all deferred handles of inode in case of handle lease break · 47592fa8
      Bharath SM 提交于
      Oplock break may occur for different file handle than the deferred
      handle. Check for inode deferred closes list, if it's not empty then
      close all the deferred handles of inode because we should not cache
      handles if we dont have handle lease.
      
      Eg: If openfilelist has one deferred file handle and another open file
      handle from app for a same file, then on a lease break we choose the
      first handle in openfile list. The first handle in list can be deferred
      handle or actual open file handle from app. In case if it is actual open
      handle then today, we don't close deferred handles if we lose handle lease
      on a file. Problem with this is, later if app decides to close the existing
      open handle then we still be caching deferred handles until deferred close
      timeout. Leaving open handle may result in sharing violation when windows
      client tries to open a file with limited file share access.
      
      So we should check for deferred list of inode and walk through the list of
      deferred files in inode and close all deferred files.
      
      Fixes: 9e31678f ("SMB3: fix lease break timeout when multiple deferred close handles for the same file.")
      Cc: stable@kernel.org
      Signed-off-by: NBharath SM <bharathsm@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      47592fa8
  2. 28 4月, 2023 1 次提交
  3. 19 4月, 2023 1 次提交
    • D
      cifs: Fix unbuffered read · ac136928
      David Howells 提交于
      If read() is done in an unbuffered manner, such that, say,
      cifs_strict_readv() goes through cifs_user_readv() and thence
      __cifs_readv(), it doesn't recognise the EOF and keeps indicating to
      userspace that it returning full buffers of data.
      
      This is due to ctx->iter being advanced in cifs_send_async_read() as the
      buffer is split up amongst a number of rdata objects.  The iterator count
      is then used in collect_uncached_read_data() in the non-DIO case to set the
      total length read - and thus the return value of sys_read().  But since the
      iterator normally gets used up completely during splitting, ctx->total_len
      gets overridden to the full amount.
      
      However, prior to that in collect_uncached_read_data(), we've gone through
      the list of rdatas and added up the amount of data we actually received
      (which we then throw away).
      
      Fix this by removing the bit that overrides the amount read in the non-DIO
      case and just going with the total added up in the aforementioned loop.
      
      This was observed by mounting a cifs share with multiple channels, e.g.:
      
      	mount //192.168.6.1/test /test/ -o user=shares,pass=...,max_channels=6
      
      and then reading a 1MiB file on the share:
      
      	strace cat /xfstest.test/1M  >/dev/null
      
      Through strace, the same data can be seen being read again and again.
      
      Fixes: d08089f6 ("cifs: Change the I/O paths to use an iterator rather than a page list")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NPaulo Alcantara (SUSE) <pc@manguebit.com>
      cc: Jérôme Glisse <jglisse@redhat.com>
      cc: Long Li <longli@microsoft.com>
      cc: Enzo Matsumiya <ematsumiya@suse.de>
      cc: Shyam Prasad N <nspmangalore@gmail.com>
      cc: Rohith Surabattula <rohiths.msft@gmail.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: linux-cifs@vger.kernel.org
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      ac136928
  4. 18 3月, 2023 1 次提交
  5. 02 3月, 2023 3 次提交
    • D
      cifs: Fix memory leak in direct I/O · 71562809
      David Howells 提交于
      When __cifs_readv() and __cifs_writev() extract pages from a user-backed
      iterator into a BVEC-type iterator, they set ->bv_need_unpin to note
      whether they need to unpin the pages later.  However, in both cases they
      examine the BVEC-type iterator and not the source iterator - and so
      bv_need_unpin doesn't get set and the pages are leaked.
      
      I think this may be responsible for the generic/208 xfstest failing
      occasionally with:
      
      	WARNING: CPU: 0 PID: 3064 at mm/gup.c:218 try_grab_page+0x65/0x100
      	RIP: 0010:try_grab_page+0x65/0x100
      	follow_page_pte+0x1a7/0x570
      	__get_user_pages+0x1a2/0x650
      	__gup_longterm_locked+0xdc/0xb50
      	internal_get_user_pages_fast+0x17f/0x310
      	pin_user_pages_fast+0x46/0x60
      	iov_iter_extract_pages+0xc9/0x510
      	? __kmalloc_large_node+0xb1/0x120
      	? __kmalloc_node+0xbe/0x130
      	netfs_extract_user_iter+0xbf/0x200 [netfs]
      	__cifs_writev+0x150/0x330 [cifs]
      	vfs_write+0x2a8/0x3c0
      	ksys_pwrite64+0x65/0xa0
      
      with the page refcount going negative.  This is less unlikely than it seems
      because the page is being pinned, not simply got, and so the refcount
      increased by 1024 each time, and so only needs to be called around ~2097152
      for the refcount to go negative.
      
      Further, the test program (aio-dio-invalidate-failure) uses a 32MiB static
      buffer and all the PTEs covering it refer to the same page because it's
      never written to.
      
      The warning in try_grab_page():
      
      	if (WARN_ON_ONCE(folio_ref_count(folio) <= 0))
      		return -ENOMEM;
      
      then trips and prevents us ever using the page again for DIO at least.
      
      Fixes: d08089f6 ("cifs: Change the I/O paths to use an iterator rather than a page list")
      Reported-by: NMurphy Zhou <jencce.kernel@gmail.com>
      Link: https://lore.kernel.org/r/CAH2r5mvaTsJ---n=265a4zqRA7pP+o4MJ36WCQUS6oPrOij8cw@mail.gmail.comSigned-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@manguebit.com>
      cc: Shyam Prasad N <nspmangalore@gmail.com>
      cc: Rohith Surabattula <rohiths.msft@gmail.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: linux-cifs@vger.kernel.org
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      71562809
    • D
      cifs: Fix cifs_write_back_from_locked_folio() · 0268792f
      David Howells 提交于
      cifs_write_back_from_locked_folio() should return the number of bytes read,
      but returns the result of ->async_writev(), which will be 0 on success.  As
      it happens, this doesn't prevent cifs_writepages_region() from working as
      it will then examine and ignore the pages that are no longer dirty rather
      than just skipping over them.
      
      Fixes: d08089f6 ("cifs: Change the I/O paths to use an iterator rather than a page list")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      cc: Shyam Prasad N <nspmangalore@gmail.com>
      cc: Rohith Surabattula <rohiths.msft@gmail.com>
      cc: Tom Talpey <tom@talpey.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: linux-cifs@vger.kernel.org
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@manguebit.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      0268792f
    • D
      cifs: Add some missing xas_retry() calls · 1907e0fe
      David Howells 提交于
      The xas_for_each loops added into fs/cifs/file.c need to go round again if
      indicated by xas_retry().
      
      Fixes: b8713c4d ("cifs: Add some helper functions")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      cc: Shyam Prasad N <nspmangalore@gmail.com>
      cc: Rohith Surabattula <rohiths.msft@gmail.com>
      cc: Tom Talpey <tom@talpey.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: linux-cifs@vger.kernel.org
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      1907e0fe
  6. 25 2月, 2023 1 次提交
  7. 21 2月, 2023 7 次提交
  8. 07 2月, 2023 1 次提交
    • Z
      cifs: Fix use-after-free in rdata->read_into_pages() · aa5465ae
      ZhaoLong Wang 提交于
      When the network status is unstable, use-after-free may occur when
      read data from the server.
      
        BUG: KASAN: use-after-free in readpages_fill_pages+0x14c/0x7e0
      
        Call Trace:
         <TASK>
         dump_stack_lvl+0x38/0x4c
         print_report+0x16f/0x4a6
         kasan_report+0xb7/0x130
         readpages_fill_pages+0x14c/0x7e0
         cifs_readv_receive+0x46d/0xa40
         cifs_demultiplex_thread+0x121c/0x1490
         kthread+0x16b/0x1a0
         ret_from_fork+0x2c/0x50
         </TASK>
      
        Allocated by task 2535:
         kasan_save_stack+0x22/0x50
         kasan_set_track+0x25/0x30
         __kasan_kmalloc+0x82/0x90
         cifs_readdata_direct_alloc+0x2c/0x110
         cifs_readdata_alloc+0x2d/0x60
         cifs_readahead+0x393/0xfe0
         read_pages+0x12f/0x470
         page_cache_ra_unbounded+0x1b1/0x240
         filemap_get_pages+0x1c8/0x9a0
         filemap_read+0x1c0/0x540
         cifs_strict_readv+0x21b/0x240
         vfs_read+0x395/0x4b0
         ksys_read+0xb8/0x150
         do_syscall_64+0x3f/0x90
         entry_SYSCALL_64_after_hwframe+0x72/0xdc
      
        Freed by task 79:
         kasan_save_stack+0x22/0x50
         kasan_set_track+0x25/0x30
         kasan_save_free_info+0x2e/0x50
         __kasan_slab_free+0x10e/0x1a0
         __kmem_cache_free+0x7a/0x1a0
         cifs_readdata_release+0x49/0x60
         process_one_work+0x46c/0x760
         worker_thread+0x2a4/0x6f0
         kthread+0x16b/0x1a0
         ret_from_fork+0x2c/0x50
      
        Last potentially related work creation:
         kasan_save_stack+0x22/0x50
         __kasan_record_aux_stack+0x95/0xb0
         insert_work+0x2b/0x130
         __queue_work+0x1fe/0x660
         queue_work_on+0x4b/0x60
         smb2_readv_callback+0x396/0x800
         cifs_abort_connection+0x474/0x6a0
         cifs_reconnect+0x5cb/0xa50
         cifs_readv_from_socket.cold+0x22/0x6c
         cifs_read_page_from_socket+0xc1/0x100
         readpages_fill_pages.cold+0x2f/0x46
         cifs_readv_receive+0x46d/0xa40
         cifs_demultiplex_thread+0x121c/0x1490
         kthread+0x16b/0x1a0
         ret_from_fork+0x2c/0x50
      
      The following function calls will cause UAF of the rdata pointer.
      
      readpages_fill_pages
       cifs_read_page_from_socket
        cifs_readv_from_socket
         cifs_reconnect
          __cifs_reconnect
           cifs_abort_connection
            mid->callback() --> smb2_readv_callback
             queue_work(&rdata->work)  # if the worker completes first,
                                       # the rdata is freed
                cifs_readv_complete
                  kref_put
                    cifs_readdata_release
                      kfree(rdata)
       return rdata->...               # UAF in readpages_fill_pages()
      
      Similarly, this problem also occurs in the uncache_fill_pages().
      
      Fix this by adjusts the order of condition judgment in the return
      statement.
      Signed-off-by: NZhaoLong Wang <wangzhaolong1@huawei.com>
      Cc: stable@vger.kernel.org
      Acked-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      aa5465ae
  9. 03 2月, 2023 2 次提交
  10. 11 1月, 2023 1 次提交
  11. 08 12月, 2022 3 次提交
  12. 30 11月, 2022 1 次提交
  13. 26 11月, 2022 1 次提交
    • A
      use less confusing names for iov_iter direction initializers · de4eda9d
      Al Viro 提交于
      READ/WRITE proved to be actively confusing - the meanings are
      "data destination, as used with read(2)" and "data source, as
      used with write(2)", but people keep interpreting those as
      "we read data from it" and "we write data to it", i.e. exactly
      the wrong way.
      
      Call them ITER_DEST and ITER_SOURCE - at least that is harder
      to misinterpret...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      de4eda9d
  14. 24 10月, 2022 2 次提交
    • Z
      cifs: Fix pages leak when writedata alloc failed in cifs_write_from_iter() · f950c85e
      Zhang Xiaoxu 提交于
      There is a kmemleak when writedata alloc failed:
      
        unreferenced object 0xffff888175ae4000 (size 4096):
          comm "dd", pid 19419, jiffies 4296028749 (age 739.396s)
          hex dump (first 32 bytes):
            80 02 b0 04 00 ea ff ff c0 02 b0 04 00 ea ff ff  ................
            80 22 4c 04 00 ea ff ff c0 22 4c 04 00 ea ff ff  ."L......"L.....
          backtrace:
            [<0000000072fdbb86>] __kmalloc_node+0x50/0x150
            [<0000000039faf56f>] __iov_iter_get_pages_alloc+0x605/0xdd0
            [<00000000f862a9d4>] iov_iter_get_pages_alloc2+0x3b/0x80
            [<000000008f226067>] cifs_write_from_iter+0x2ae/0xe40
            [<000000001f78f2f1>] __cifs_writev+0x337/0x5c0
            [<00000000257fcef5>] vfs_write+0x503/0x690
            [<000000008778a238>] ksys_write+0xb9/0x150
            [<00000000ed82047c>] do_syscall_64+0x35/0x80
            [<000000003365551d>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      __iov_iter_get_pages_alloc+0x605/0xdd0 is:
        want_pages_array at lib/iov_iter.c:1304
        (inlined by) __iov_iter_get_pages_alloc at lib/iov_iter.c:1457
      
      If writedata allocate failed, the pages and pagevec should be cleanup.
      
      Fixes: 8c5f9c1a ("CIFS: Add support for direct I/O write")
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      f950c85e
    • Z
      cifs: Fix pages array leak when writedata alloc failed in cifs_writedata_alloc() · 4153d789
      Zhang Xiaoxu 提交于
      There is a memory leak when writedata alloc failed:
      
        unreferenced object 0xffff888192364000 (size 8192):
          comm "sync", pid 22839, jiffies 4297313967 (age 60.230s)
          hex dump (first 32 bytes):
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          backtrace:
            [<0000000027de0814>] __kmalloc+0x4d/0x150
            [<00000000b21e81ab>] cifs_writepages+0x35f/0x14a0
            [<0000000076f7d20e>] do_writepages+0x10a/0x360
            [<00000000d6a36edc>] filemap_fdatawrite_wbc+0x95/0xc0
            [<000000005751a323>] __filemap_fdatawrite_range+0xa7/0xe0
            [<0000000088afb0ca>] file_write_and_wait_range+0x66/0xb0
            [<0000000063dbc443>] cifs_strict_fsync+0x80/0x5f0
            [<00000000c4624754>] __x64_sys_fsync+0x40/0x70
            [<000000002c0dc744>] do_syscall_64+0x35/0x80
            [<0000000052f46bee>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      cifs_writepages+0x35f/0x14a0 is:
        kmalloc_array at include/linux/slab.h:628
        (inlined by) kcalloc at include/linux/slab.h:659
        (inlined by) cifs_writedata_alloc at fs/cifs/file.c:2438
        (inlined by) wdata_alloc_and_fillpages at fs/cifs/file.c:2527
        (inlined by) cifs_writepages at fs/cifs/file.c:2705
      
      If writedata alloc failed in cifs_writedata_alloc(), the pages array
      should be freed.
      
      Fixes: 8e7360f6 ("CIFS: Add support for direct pages in wdata")
      Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      4153d789
  15. 19 10月, 2022 1 次提交
  16. 15 10月, 2022 1 次提交
  17. 13 10月, 2022 1 次提交
    • P
      cifs: improve symlink handling for smb2+ · 76894f3e
      Paulo Alcantara 提交于
      When creating inode for symlink, the client used to send below
      requests to fill it in:
      
          * create+query_info+close (STATUS_STOPPED_ON_SYMLINK)
          * create(+reparse_flag)+query_info+close (set file attrs)
          * create+ioctl(get_reparse)+close (query reparse tag)
      
      and then for every access to the symlink dentry, the ->link() method
      would send another:
      
          * create+ioctl(get_reparse)+close (parse symlink)
      
      So, in order to improve:
      
          (i) Get rid of unnecessary roundtrips and then resolve symlinks as
      	follows:
      
              * create+query_info+close (STATUS_STOPPED_ON_SYMLINK +
      	                           parse symlink + get reparse tag)
              * create(+reparse_flag)+query_info+close (set file attrs)
      
          (ii) Set the resolved symlink target directly in inode->i_link and
               use simple_get_link() for ->link() to simply return it.
      Signed-off-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      76894f3e
  18. 26 9月, 2022 1 次提交
  19. 13 9月, 2022 1 次提交
  20. 12 8月, 2022 2 次提交
  21. 11 8月, 2022 2 次提交
    • R
      cifs: Move cached-dir functions into a separate file · 05b98fd2
      Ronnie Sahlberg 提交于
      Also rename crfid to cfid to have consistent naming for this variable.
      
      This commit does not change any logic.
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      05b98fd2
    • P
      cifs: fix lock length calculation · 773891ff
      Paulo Alcantara 提交于
      The lock length was wrongly set to 0 when fl_end == OFFSET_MAX, thus
      failing to lock the whole file when l_start=0 and l_len=0.
      
      This fixes test 2 from cthon04.
      
      Before patch:
      
      $ ./cthon04/lock/tlocklfs -t 2 /mnt
      
      Creating parent/child synchronization pipes.
      
      Test #1 - Test regions of an unlocked file.
              Parent: 1.1  - F_TEST  [               0,               1] PASSED.
              Parent: 1.2  - F_TEST  [               0,          ENDING] PASSED.
              Parent: 1.3  - F_TEST  [               0,7fffffffffffffff] PASSED.
              Parent: 1.4  - F_TEST  [               1,               1] PASSED.
              Parent: 1.5  - F_TEST  [               1,          ENDING] PASSED.
              Parent: 1.6  - F_TEST  [               1,7fffffffffffffff] PASSED.
              Parent: 1.7  - F_TEST  [7fffffffffffffff,               1] PASSED.
              Parent: 1.8  - F_TEST  [7fffffffffffffff,          ENDING] PASSED.
              Parent: 1.9  - F_TEST  [7fffffffffffffff,7fffffffffffffff] PASSED.
      
      Test #2 - Try to lock the whole file.
              Parent: 2.0  - F_TLOCK [               0,          ENDING] PASSED.
              Child:  2.1  - F_TEST  [               0,               1] FAILED!
              Child:  **** Expected EACCES, returned success...
              Child:  **** Probably implementation error.
      
      **  CHILD pass 1 results: 0/0 pass, 0/0 warn, 1/1 fail (pass/total).
              Parent: Child died
      
      ** PARENT pass 1 results: 10/10 pass, 0/0 warn, 0/0 fail (pass/total).
      
      After patch:
      
      $ ./cthon04/lock/tlocklfs -t 2 /mnt
      
      Creating parent/child synchronization pipes.
      
      Test #2 - Try to lock the whole file.
              Parent: 2.0  - F_TLOCK [               0,          ENDING] PASSED.
              Child:  2.1  - F_TEST  [               0,               1] PASSED.
              Child:  2.2  - F_TEST  [               0,          ENDING] PASSED.
              Child:  2.3  - F_TEST  [               0,7fffffffffffffff] PASSED.
              Child:  2.4  - F_TEST  [               1,               1] PASSED.
              Child:  2.5  - F_TEST  [               1,          ENDING] PASSED.
              Child:  2.6  - F_TEST  [               1,7fffffffffffffff] PASSED.
              Child:  2.7  - F_TEST  [7fffffffffffffff,               1] PASSED.
              Child:  2.8  - F_TEST  [7fffffffffffffff,          ENDING] PASSED.
              Child:  2.9  - F_TEST  [7fffffffffffffff,7fffffffffffffff] PASSED.
              Parent: 2.10 - F_ULOCK [               0,          ENDING] PASSED.
      
      ** PARENT pass 1 results: 2/2 pass, 0/0 warn, 0/0 fail (pass/total).
      
      **  CHILD pass 1 results: 9/9 pass, 0/0 warn, 0/0 fail (pass/total).
      
      Fixes: d80c6984 ("cifs: fix signed integer overflow when fl_end is OFFSET_MAX")
      Reported-by: NXiaoli Feng <xifeng@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      773891ff
  22. 09 8月, 2022 2 次提交
    • A
      iov_iter: advancing variants of iov_iter_get_pages{,_alloc}() · 1ef255e2
      Al Viro 提交于
      Most of the users immediately follow successful iov_iter_get_pages()
      with advancing by the amount it had returned.
      
      Provide inline wrappers doing that, convert trivial open-coded
      uses of those.
      
      BTW, iov_iter_get_pages() never returns more than it had been asked
      to; such checks in cifs ought to be removed someday...
      Reviewed-by: NJeff Layton <jlayton@kernel.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1ef255e2
    • A
      new iov_iter flavour - ITER_UBUF · fcb14cb1
      Al Viro 提交于
      Equivalent of single-segment iovec.  Initialized by iov_iter_ubuf(),
      checked for by iter_is_ubuf(), otherwise behaves like ITER_IOVEC
      ones.
      
      We are going to expose the things like ->write_iter() et.al. to those
      in subsequent commits.
      
      New predicate (user_backed_iter()) that is true for ITER_IOVEC and
      ITER_UBUF; places like direct-IO handling should use that for
      checking that pages we modify after getting them from iov_iter_get_pages()
      would need to be dirtied.
      
      DO NOT assume that replacing iter_is_iovec() with user_backed_iter()
      will solve all problems - there's code that uses iter_is_iovec() to
      decide how to poke around in iov_iter guts and for that the predicate
      replacement obviously won't suffice.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      fcb14cb1
  23. 06 8月, 2022 1 次提交
    • S
      cifs: when insecure legacy is disabled shrink amount of SMB1 code · fb157ed2
      Steve French 提交于
      Currently much of the smb1 code is built even when
      CONFIG_CIFS_ALLOW_INSECURE_LEGACY is disabled.
      
      Move cifssmb.c to only be compiled when insecure legacy is disabled,
      and move various SMB1/CIFS helper functions to that ifdef.  Some
      functions that were not SMB1/CIFS specific needed to be moved out of
      cifssmb.c
      
      This shrinks cifs.ko by more than 10% which is good - but also will
      help with the eventual movement of the legacy code to a distinct
      module.  Follow on patches can shrink the number of ifdefs by
      code restructuring where smb1 code is wedged in functions that
      should be calling dialect specific helper functions instead,
      and also by moving some functions from file.c/dir.c/inode.c into
      smb1 specific c files.
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      fb157ed2
  24. 01 8月, 2022 1 次提交