diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 09:12:00 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 14:15:26 +0200 |
commit | f21f62208a6f60e2e05440b2e438d9541822dc4d (patch) | |
tree | e373be2998ac4914122f9da76398be980d0dbd47 /fs/super.c | |
parent | Make allocation of anon devices cheaper (diff) | |
download | linux-f21f62208a6f60e2e05440b2e438d9541822dc4d.tar.xz linux-f21f62208a6f60e2e05440b2e438d9541822dc4d.zip |
... and the same for vfsmount id/mount group id
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r-- | fs/super.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/super.c b/fs/super.c index 808ffd59e01b..2761d3e22ed9 100644 --- a/fs/super.c +++ b/fs/super.c @@ -620,7 +620,8 @@ int set_anon_super(struct super_block *s, void *data) return -ENOMEM; spin_lock(&unnamed_dev_lock); error = ida_get_new_above(&unnamed_dev_ida, unnamed_dev_start, &dev); - unnamed_dev_start = dev + 1; + if (!error) + unnamed_dev_start = dev + 1; spin_unlock(&unnamed_dev_lock); if (error == -EAGAIN) /* We raced and lost with another CPU. */ @@ -631,7 +632,8 @@ int set_anon_super(struct super_block *s, void *data) if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) { spin_lock(&unnamed_dev_lock); ida_remove(&unnamed_dev_ida, dev); - unnamed_dev_start = dev; + if (unnamed_dev_start > dev) + unnamed_dev_start = dev; spin_unlock(&unnamed_dev_lock); return -EMFILE; } |