IP Library Granted Patent US 12,222,904
Granted Patent B2
US 12,222,904 · App. 18/189,979 · Granted Feb 11, 2025

Avoiding data inconsistency in a file system using 2-level synchronization

Inventors: Mahesh Hiregoudar (Bangalore, IN); Prasanna Aithal (Bangalore, IN); Prasad Rao Jangam (Bangalore, IN); Srinivasa Shantharam (Bangalore, IN); Rohan Pasalkar (Palo Alto, CA); Srikanth Mahabalarao (Bangalore, IN)
Assignee: VMware LLC
G06F16/178G06F16/1727G06F16/1774G06F16/188
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,222,904
App. No.
18/189,979
Granted
Feb 11, 2025
Kind
B2
Abstract

A method of synchronously executing input/output operations (IOs) for a plurality of applications using a storage device with a file system includes the steps of: receiving a first write IO including an instruction to write first data at a first address of the file system; determining that, within a first range of the file system comprising the first address, there are no pending unmap IOs for deallocating storage space of the storage device from files of the plurality of applications; after determining that there are no pending unmap IOs within the first range, locking the first range to prevent incoming unmap IOs from deallocating storage space within the first range from the files of the plurality of applications; after locking the first range, writing the first data to the storage device at the first address; and after writing the first data, unlocking the first range.

Claims (62)

1. A method of synchronously executing input/output operations (IOs) issued by a plurality of virtual computing instances to a file system implemented by one or more storage devices, the method comprising:

detecting a first write IO issued by one of the virtual computing instances, wherein the first write IO includes an instruction to write first data at a first address of a file data block of a file of the file system;

determining by checking metadata of a pointer block of the file that points to the file data block, that a first address range of the file system comprising the first address is locked so as to prevent any pending unmap IOs issued by the virtual computing instances from deallocating storage space of the one or more storage devices mapped to addresses of file data blocks within the first address range; and

in response to determining that the first address range is locked, writing the first data to the one or more storage devices at the first address while the first address range is locked.

2. The method of claim 1 , further comprising:

before writing the first data to the one or more storage devices, incrementing a variable of the pointer block that identifies a number of pending write IOs issued by the virtual computing instances including instructions to write data at addresses of file data blocks within a second address range of the file system that comprises the first address range; and

after writing the first data to the one or more storage devices, decrementing the variable.

3. The method of claim 1 , further comprising:

unlocking the first address range when there are no pending write IOs issued by the virtual computing instances including instructions to write data at addresses of file data blocks within the first address range, so as to allow an unmap IO issued by the one of the virtual computing instances to deallocate storage space of the one or more storage devices mapped to a second address of a file data block of the file within the first address range.

4. The method of claim 1 , further comprising:

before determining that the first address range is locked, determining that there is a pending unmap IO issued by the virtual computing instances for deallocating storage space of the one or more storage devices mapped to a second address of a file data block of the file within a second address range of the file system that comprises the first address range.

5. The method of claim 1 , wherein the file system is a virtual machine file system, the first write IO is a small computer system interface (SCSI) write command, and unmap IOs issued by the virtual computing instances are SCSI unmap commands.

6. The method of claim 1 , further comprising:

detecting an unmap IO issued by the one of the virtual computing instances including an instruction to deallocate storage space mapped to a second address of a file data block of the file within the first address range;

in response to detecting the unmap IO, determining that the first address range is not locked for any pending write IOs issued by the virtual computing instances; and

in response to determining that the first address range is not locked for any pending write IOs,

locking the first address range so as to prevent any incoming write IOs issued by the virtual computing instances from writing data at addresses of file data blocks within the first address range, then

deallocating the storage space mapped to the second address, and then

unlocking the first address range so as to allow incoming write IOs issued by the virtual computing instances to write data at addresses of file data blocks within the first address range.

7. The method of claim 6 , further comprising:

in response to detecting the unmap IO, incrementing a variable of the pointer block that indicates a number of pending unmap IOs issued by the virtual computing instances for deallocating storage space mapped to addresses of file data blocks within the first address range.

8. A non-transitory computer-readable medium comprising instructions that are executable in a computer system, wherein the instructions when executed cause one or more storage devices of the computer system to carry out a method of synchronously executing input/output operations (IOs) issued by a plurality of virtual computing instances to a file system implemented by the one or more storage devices, and wherein the method comprises:

detecting a first write IO issued by one of the virtual computing instances, wherein the first write IO includes an instruction to write first data at a first address of a file data block of a file of the file system;

determining by checking metadata of a pointer block of the file that points to the file data block, that a first address range of the file system comprising the first address is locked so as to prevent any pending unmap IOs issued by the virtual computing instances from deallocating storage space of the one or more storage devices mapped to addresses of file data blocks within the first address range; and

in response to determining that the first address range is locked, writing the first data to the one or more storage devices at the first address while the first address range is locked.

9. The non-transitory computer-readable medium of claim 8 , wherein the method further comprises:

before writing the first data to the one or more storage devices, incrementing a variable of the pointer block that identifies a number of pending write IOs issued by the virtual computing instances including instructions to write data at addresses of file data blocks within a second address range of the file system that comprises the first address range; and

after writing the first data to the one or more storage devices, decrementing the variable.

10. The non-transitory computer-readable medium of claim 8 , wherein the method further comprises:

unlocking the first address range when there are no pending write IOs issued by the virtual computing instances including instructions to write data at addresses of file data blocks within the first address range, so as to allow an unmap IO issued by the one of the virtual computing instances to deallocate storage space of the one or more storage devices mapped to a second address of a file data block of the file within the first address range.

11. The non-transitory computer-readable medium of claim 8 , wherein the method further comprises:

before determining that the first address range is locked, determining that there is a pending unmap IO issued by the virtual computing instances for deallocating storage space of the one or more storage devices mapped to a second address of a file data block of the file within a second address range of the file system that comprises the first address range.

12. The non-transitory computer-readable medium of claim 8 , wherein the file system is a virtual machine file system, the first write IO is a small computer system interface (SCSI) write command, and unmap IOs issued by the virtual computing instances are SCSI unmap commands.

13. The non-transitory computer-readable medium of claim 8 , wherein the method further comprises:

detecting an unmap IO issued by the one of the virtual computing instances including an instruction to deallocate storage space mapped to a second address of a file data block of the file within the first address range;

in response to detecting the unmap IO, determining that the first address range is not locked for any pending write IOs issued by the virtual computing instances; and

in response to determining that the first address range is not locked for any pending write IOs,

locking the first address range so as to prevent any incoming write IOs issued by the virtual computing instances from writing data at addresses of file data blocks within the first address range, then

deallocating the storage space mapped to the second address, and then

unlocking the first address range so as to allow incoming write IOs issued by the virtual computing instances to write data at addresses of file data blocks within the first address range.

14. The non-transitory computer-readable medium of claim 13 , wherein the method further comprises:

in response to detecting the unmap IO, incrementing a variable of the pointer block that indicates a number of pending unmap IOs issued by the virtual computing instances for deallocating storage space mapped to addresses of file data blocks within the first address range.

15. One or more storage devices implementing a file system for a plurality of virtual computing instances, wherein the one or more storage devices include a processor configured to:

detect a first write IO issued by one of the virtual computing instances, wherein the first write IO includes an instruction to write first data at a first address of a file data block of a file of the file system;

determine by checking metadata of a pointer block of the file that points to the file data block, that a first address range of the file system comprising the first address is locked so as to prevent any pending unmap IOs issued by the virtual computing instances from deallocating storage space of the one or more storage devices mapped to addresses of file data blocks within the first address range; and

in response to determining that the first address range is locked, write the first data at the first address while the first address range is locked.

16. The one or more storage devices of claim 15 , wherein the processor is further configured to:

before writing the first data at the first address, increment a variable of the pointer block that identifies a number of pending write IOs issued by the virtual computing instances including instructions to write data at addresses of file data blocks within a second address range of the file system that comprises the first address range; and

after writing the first data at the first address, decrement the variable.

17. The one or more storage devices of claim 15 , wherein the processor is further configured to:

unlock the first address range when there are no pending write IOs issued by the virtual computing instances including instructions to write data at addresses of file data blocks within the first address range, so as to allow an unmap IO issued by the one of the virtual computing instances to deallocate storage space of the one or more storage devices mapped to a second address of a file data block of the file within the first address range.

18. The one or more storage devices of claim 15 , wherein the processor is further configured to:

before determining that the first address range is locked, determine that there is a pending unmap IO issued by the virtual computing instances for deallocating storage space of the one or more storage devices mapped to a second address of a file data block of the file within a second address range of the file system that comprises the first address range.

19. The one or more storage devices of claim 15 , wherein the processor is further configured to:

detect an unmap IO issued by the one of the virtual computing instances including an instruction to deallocate storage space mapped to a second address of a file data block of the file within the first address range;

in response to detecting the unmap IO, determine that the first address range is not locked for any pending write IOs issued by the virtual computing instances; and

in response to determining that the first address range is not locked for any pending write IOs,

lock the first address range so as to prevent any incoming write IOs issued by the virtual computing instances from writing data at addresses of file data blocks within the first address range, then

deallocate the storage space mapped to the second address, and then

unlock the first address range so as to allow incoming write IOs issued by the virtual computing instances to write data at addresses of file data blocks within the first address range.

20. The one or more storage devices of claim 19 , wherein the processor is further configured to:

in response to detecting the unmap IO, increment a variable of the pointer block that indicates a number of pending unmap IOs issued by the virtual computing instances for deallocating storage space mapped to addresses of file data blocks within the first address range.

Assignments (1)
CHANGE OF NAME Recorded Apr 15, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 067102/0242 →
Priority Claims (1)
IN 202141028268 · Jun 23, 2021 · national
Continuity (2)
Continuation 17398065 · Aug 10, 2021
Related Publication 20230229636A1 · Jul 20, 2023
References Cited (7)
US 6789156B1 · Waldspurger · 2004 [cited by applicant]
US 20140195725A1 · Bennett · 2014 [cited by applicant]
US 20160070652A1 · Sundararaman · 2016 [cited by examiner]
US 20180032541A1 · Park et al. · 2018 [cited by applicant]
US 20180267894A1 · Jangam et al. · 2018 [cited by applicant]
US 20200004993A1 · Volos · 2020 [cited by examiner]
US 20200150865A1 · Krishnamurthy · 2020 [cited by applicant]