Patch "NFS: Allow very small rsize & wsize again" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    NFS: Allow very small rsize & wsize again

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfs-allow-very-small-rsize-wsize-again.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f3805ae8ac3b5bcc01c426f8c5f9adb3bfdc623a
Author: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
Date:   Wed Nov 30 15:30:47 2022 -0500

    NFS: Allow very small rsize & wsize again
    
    [ Upstream commit a60214c2465493aac0b014d87ee19327b6204c42 ]
    
    940261a19508 introduced nfs_io_size() to clamp the iosize to a multiple
    of PAGE_SIZE. This had the unintended side effect of no longer allowing
    iosizes less than a page, which could be useful in some situations.
    
    UDP already has an exception that causes it to fall back on the
    power-of-two style sizes instead. This patch adds an additional
    exception for very small iosizes.
    
    Reported-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Fixes: 940261a19508 ("NFS: Allow setting rsize / wsize to a multiple of PAGE_SIZE")
    Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
    Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 898dd95bc7a7..c194a1e50f0b 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -741,12 +741,10 @@ unsigned long nfs_io_size(unsigned long iosize, enum xprt_transports proto)
 		iosize = NFS_DEF_FILE_IO_SIZE;
 	else if (iosize >= NFS_MAX_FILE_IO_SIZE)
 		iosize = NFS_MAX_FILE_IO_SIZE;
-	else
-		iosize = iosize & PAGE_MASK;
 
-	if (proto == XPRT_TRANSPORT_UDP)
+	if (proto == XPRT_TRANSPORT_UDP || iosize < PAGE_SIZE)
 		return nfs_block_bits(iosize, NULL);
-	return iosize;
+	return iosize & PAGE_MASK;
 }
 
 /*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux