Btrfs: Show a warning message if one of objectid reaches its highest value
authorSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Wed, 9 Mar 2016 06:18:57 +0000 (15:18 +0900)
committerDavid Sterba <dsterba@suse.com>
Fri, 11 Mar 2016 16:12:35 +0000 (17:12 +0100)
It's better to show a warning message for the exceptional case
that one of objectid (in most case, inode number) reaches its
highest value. For example, if inode cache is off and this event
happens, we can't create any file even if there are not so many files.
This message ease detecting such problem.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode-map.c

index e50316c4af157183d3862fac8e318abe7eb66ecd..1f0ec19b23f615faae7a6ba81b6b203657ae4d23 100644 (file)
@@ -556,6 +556,9 @@ int btrfs_find_free_objectid(struct btrfs_root *root, u64 *objectid)
        mutex_lock(&root->objectid_mutex);
 
        if (unlikely(root->highest_objectid >= BTRFS_LAST_FREE_OBJECTID)) {
+               btrfs_warn(root->fs_info,
+                          "the objectid of root %llu reaches its highest value",
+                          root->root_key.objectid);
                ret = -ENOSPC;
                goto out;
        }