diff options
Diffstat (limited to 'fs/ntfs')
-rw-r--r-- | fs/ntfs/ChangeLog | 2 | ||||
-rw-r--r-- | fs/ntfs/lcnalloc.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 71680a92b4d6..e0b4adf5adce 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -98,6 +98,8 @@ ToDo/Notes: | |||
98 | - Rename fs/ntfs/attrib.c::ntfs_find_vcn_nolock() to | 98 | - Rename fs/ntfs/attrib.c::ntfs_find_vcn_nolock() to |
99 | ntfs_attr_find_vcn_nolock() and update all callers. | 99 | ntfs_attr_find_vcn_nolock() and update all callers. |
100 | - Add fs/ntfs/attrib.[hc]::ntfs_attr_make_non_resident(). | 100 | - Add fs/ntfs/attrib.[hc]::ntfs_attr_make_non_resident(). |
101 | - Fix sign of various error return values to be negative in | ||
102 | fs/ntfs/lcnalloc.c. | ||
101 | 103 | ||
102 | 2.1.22 - Many bug and race fixes and error handling improvements. | 104 | 2.1.22 - Many bug and race fixes and error handling improvements. |
103 | 105 | ||
diff --git a/fs/ntfs/lcnalloc.c b/fs/ntfs/lcnalloc.c index 6e584ab743c5..71bf08730b05 100644 --- a/fs/ntfs/lcnalloc.c +++ b/fs/ntfs/lcnalloc.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * lcnalloc.c - Cluster (de)allocation code. Part of the Linux-NTFS project. | 2 | * lcnalloc.c - Cluster (de)allocation code. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2004 Anton Altaparmakov | 4 | * Copyright (c) 2004-2005 Anton Altaparmakov |
5 | * | 5 | * |
6 | * This program/include file is free software; you can redistribute it and/or | 6 | * This program/include file is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as published | 7 | * modify it under the terms of the GNU General Public License as published |
@@ -60,7 +60,7 @@ int ntfs_cluster_free_from_rl_nolock(ntfs_volume *vol, | |||
60 | if (rl->lcn < 0) | 60 | if (rl->lcn < 0) |
61 | continue; | 61 | continue; |
62 | err = ntfs_bitmap_clear_run(lcnbmp_vi, rl->lcn, rl->length); | 62 | err = ntfs_bitmap_clear_run(lcnbmp_vi, rl->lcn, rl->length); |
63 | if (unlikely(err && (!ret || ret == ENOMEM) && ret != err)) | 63 | if (unlikely(err && (!ret || ret == -ENOMEM) && ret != err)) |
64 | ret = err; | 64 | ret = err; |
65 | } | 65 | } |
66 | ntfs_debug("Done."); | 66 | ntfs_debug("Done."); |
@@ -693,7 +693,7 @@ switch_to_data1_zone: search_zone = 2; | |||
693 | if (zone == MFT_ZONE || mft_zone_size <= 0) { | 693 | if (zone == MFT_ZONE || mft_zone_size <= 0) { |
694 | ntfs_debug("No free clusters left, going to out."); | 694 | ntfs_debug("No free clusters left, going to out."); |
695 | /* Really no more space left on device. */ | 695 | /* Really no more space left on device. */ |
696 | err = ENOSPC; | 696 | err = -ENOSPC; |
697 | goto out; | 697 | goto out; |
698 | } /* zone == DATA_ZONE && mft_zone_size > 0 */ | 698 | } /* zone == DATA_ZONE && mft_zone_size > 0 */ |
699 | ntfs_debug("Shrinking mft zone."); | 699 | ntfs_debug("Shrinking mft zone."); |
@@ -757,9 +757,9 @@ out: | |||
757 | if (rl) { | 757 | if (rl) { |
758 | int err2; | 758 | int err2; |
759 | 759 | ||
760 | if (err == ENOSPC) | 760 | if (err == -ENOSPC) |
761 | ntfs_debug("Not enough space to complete allocation, " | 761 | ntfs_debug("Not enough space to complete allocation, " |
762 | "err ENOSPC, first free lcn 0x%llx, " | 762 | "err -ENOSPC, first free lcn 0x%llx, " |
763 | "could allocate up to 0x%llx " | 763 | "could allocate up to 0x%llx " |
764 | "clusters.", | 764 | "clusters.", |
765 | (unsigned long long)rl[0].lcn, | 765 | (unsigned long long)rl[0].lcn, |
@@ -775,10 +775,10 @@ out: | |||
775 | } | 775 | } |
776 | /* Free the runlist. */ | 776 | /* Free the runlist. */ |
777 | ntfs_free(rl); | 777 | ntfs_free(rl); |
778 | } else if (err == ENOSPC) | 778 | } else if (err == -ENOSPC) |
779 | ntfs_debug("No space left at all, err = ENOSPC, " | 779 | ntfs_debug("No space left at all, err = -ENOSPC, first free " |
780 | "first free lcn = 0x%llx.", | 780 | "lcn = 0x%llx.", |
781 | (unsigned long long)vol->data1_zone_pos); | 781 | (long long)vol->data1_zone_pos); |
782 | up_write(&vol->lcnbmp_lock); | 782 | up_write(&vol->lcnbmp_lock); |
783 | return ERR_PTR(err); | 783 | return ERR_PTR(err); |
784 | } | 784 | } |