md-cluster: choose correct label when clustered layout is not supported
[sfrench/cifs-2.6.git] / fs / readdir.c
index d336db65a33eaa4124a741e89fbbbee6b849850f..1b83b0ad183b656b06597dc65ab7d42883cc116e 100644 (file)
@@ -37,13 +37,12 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
        if (res)
                goto out;
 
-       if (shared) {
-               inode_lock_shared(inode);
-       } else {
+       if (shared)
+               res = down_read_killable(&inode->i_rwsem);
+       else
                res = down_write_killable(&inode->i_rwsem);
-               if (res)
-                       goto out;
-       }
+       if (res)
+               goto out;
 
        res = -ENOENT;
        if (!IS_DEADDIR(inode)) {