Bug 2219273

Summary: sometimes NFS 4.2 SEEK operation is skipping holes and treating hole as data in a sparse file
Product: [Fedora] Fedora Reporter: Mohadeb Mondal <mohadeb.mondal>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 37CC: acaringi, adscvr, airlied, alciregi, bskeggs, hdegoede, hpa, jarodwilson, josef, kernel-maint, lgoncalv, linville, masami256, mchehab, ptalbert, steved
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
capture of sparse file creation in NFS 4.2 mount of Fedora 37 server
none
file copy operation in NFS 4.2 mount in Fedora 37 server none

Description Mohadeb Mondal 2023-07-03 07:12:32 UTC
In my Fedora NFS(4.2) server I have created sparse files.(Attached packet capture). It contains file with (16 KB data followed by 32 KB hole) & (8 KB data followed by 16 KB hole).
After that I have used another Fedora 37 machine as client to do file copy operation using NFS 4.2.(packet capture attached).
In this copy operation it exchanges NFS 4.2 SEEK packet. while the response in most of SEEK operation is as per the size with which the file was created, sometimes, I could see that NFS SEEK response has skipped holes. As a result the next READ operation has more data length.(packet no 499,500,501) (1131,1132,1133) can be checked for this.

Reproducible: Always

Steps to Reproduce:
1. Create two exports in a NFS 4.2 server in Fedora 37.
2.Created a sparse file which contains 16KB data followed by 32KB Hole multiple times in one of the exports.
3.Then mount both exports using NFS 4.2.
4.Start packet capture at server/client and copy file from one export to the other.
5.Check the packet capture for SEEK response and next NFS READ size.
Actual Results:  
It will be visible that few holes are skipped.

Expected Results:  
It should not skip holes sometimes and report correct data in SEEK response.

Comment 1 Mohadeb Mondal 2023-07-03 07:17:36 UTC
Created attachment 1973828 [details]
capture of sparse file creation in NFS 4.2 mount of Fedora 37 server

capture of sparse file creation in NFS 4.2 mount of Fedora 37 server.
10.52.72.77 is the NFS 4.2 Fedora 37 server
Kernel version 6.1.6-200.fc37.x86_64

Comment 2 Mohadeb Mondal 2023-07-03 07:21:06 UTC
Created attachment 1973829 [details]
file copy operation in NFS 4.2 mount in Fedora 37 server

file copy operation in NFS 4.2 mount in Fedora 37 server.
10.52.72.77 is the server. 10.52.72.106 is the client
(packet no 499,500,501) (1131,1132,1133) can be checked. Multiple similar packet is present later.