Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'zonefs-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs

Pull zonefs fixes from Damien Le Moal:

- Fix a race between zonefs module initialization of sysfs attribute
directory and mounting a drive (from Xiaoxu).

- Fix active zone accounting in the rare case of an IO error due to a
zone transition to offline or read-only state (from me).

* tag 'zonefs-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
zonefs: Fix active zone accounting
zonefs: Fix race between modprobe and mount

+21 -8
+17 -6
fs/zonefs/super.c
··· 41 41 return; 42 42 43 43 /* 44 + * For zones that transitioned to the offline or readonly condition, 45 + * we only need to clear the active state. 46 + */ 47 + if (zi->i_flags & (ZONEFS_ZONE_OFFLINE | ZONEFS_ZONE_READONLY)) 48 + goto out; 49 + 50 + /* 44 51 * If the zone is active, that is, if it is explicitly open or 45 52 * partially written, check if it was already accounted as active. 46 53 */ ··· 60 53 return; 61 54 } 62 55 56 + out: 63 57 /* The zone is not active. If it was, update the active count */ 64 58 if (zi->i_flags & ZONEFS_ZONE_ACTIVE) { 65 59 zi->i_flags &= ~ZONEFS_ZONE_ACTIVE; ··· 332 324 inode->i_flags |= S_IMMUTABLE; 333 325 inode->i_mode &= ~0777; 334 326 zone->wp = zone->start; 327 + zi->i_flags |= ZONEFS_ZONE_OFFLINE; 335 328 return 0; 336 329 case BLK_ZONE_COND_READONLY: 337 330 /* ··· 351 342 zone->cond = BLK_ZONE_COND_OFFLINE; 352 343 inode->i_mode &= ~0777; 353 344 zone->wp = zone->start; 345 + zi->i_flags |= ZONEFS_ZONE_OFFLINE; 354 346 return 0; 355 347 } 348 + zi->i_flags |= ZONEFS_ZONE_READONLY; 356 349 inode->i_mode &= ~0222; 357 350 return i_size_read(inode); 358 351 case BLK_ZONE_COND_FULL: ··· 1933 1922 if (ret) 1934 1923 return ret; 1935 1924 1936 - ret = register_filesystem(&zonefs_type); 1925 + ret = zonefs_sysfs_init(); 1937 1926 if (ret) 1938 1927 goto destroy_inodecache; 1939 1928 1940 - ret = zonefs_sysfs_init(); 1929 + ret = register_filesystem(&zonefs_type); 1941 1930 if (ret) 1942 - goto unregister_fs; 1931 + goto sysfs_exit; 1943 1932 1944 1933 return 0; 1945 1934 1946 - unregister_fs: 1947 - unregister_filesystem(&zonefs_type); 1935 + sysfs_exit: 1936 + zonefs_sysfs_exit(); 1948 1937 destroy_inodecache: 1949 1938 zonefs_destroy_inodecache(); 1950 1939 ··· 1953 1942 1954 1943 static void __exit zonefs_exit(void) 1955 1944 { 1945 + unregister_filesystem(&zonefs_type); 1956 1946 zonefs_sysfs_exit(); 1957 1947 zonefs_destroy_inodecache(); 1958 - unregister_filesystem(&zonefs_type); 1959 1948 } 1960 1949 1961 1950 MODULE_AUTHOR("Damien Le Moal");
+4 -2
fs/zonefs/zonefs.h
··· 39 39 return ZONEFS_ZTYPE_SEQ; 40 40 } 41 41 42 - #define ZONEFS_ZONE_OPEN (1 << 0) 43 - #define ZONEFS_ZONE_ACTIVE (1 << 1) 42 + #define ZONEFS_ZONE_OPEN (1U << 0) 43 + #define ZONEFS_ZONE_ACTIVE (1U << 1) 44 + #define ZONEFS_ZONE_OFFLINE (1U << 2) 45 + #define ZONEFS_ZONE_READONLY (1U << 3) 44 46 45 47 /* 46 48 * In-memory inode data.