aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-24 03:12:00 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 08:15:26 -0400
commitf21f62208a6f60e2e05440b2e438d9541822dc4d (patch)
treee373be2998ac4914122f9da76398be980d0dbd47 /fs/super.c
parentc63e09ecccb50f930e899d7005edc5411ee86d4f (diff)
... and the same for vfsmount id/mount group id
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c6
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)
620 return -ENOMEM; 620 return -ENOMEM;
621 spin_lock(&unnamed_dev_lock); 621 spin_lock(&unnamed_dev_lock);
622 error = ida_get_new_above(&unnamed_dev_ida, unnamed_dev_start, &dev); 622 error = ida_get_new_above(&unnamed_dev_ida, unnamed_dev_start, &dev);
623 unnamed_dev_start = dev + 1; 623 if (!error)
624 unnamed_dev_start = dev + 1;
624 spin_unlock(&unnamed_dev_lock); 625 spin_unlock(&unnamed_dev_lock);
625 if (error == -EAGAIN) 626 if (error == -EAGAIN)
626 /* We raced and lost with another CPU. */ 627 /* We raced and lost with another CPU. */
@@ -631,7 +632,8 @@ int set_anon_super(struct super_block *s, void *data)
631 if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) { 632 if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) {
632 spin_lock(&unnamed_dev_lock); 633 spin_lock(&unnamed_dev_lock);
633 ida_remove(&unnamed_dev_ida, dev); 634 ida_remove(&unnamed_dev_ida, dev);
634 unnamed_dev_start = dev; 635 if (unnamed_dev_start > dev)
636 unnamed_dev_start = dev;
635 spin_unlock(&unnamed_dev_lock); 637 spin_unlock(&unnamed_dev_lock);
636 return -EMFILE; 638 return -EMFILE;
637 } 639 }