]> Pileus Git - ~andy/linux/blobdiff - fs/nfs/nfs4filelayout.c
Merge tag 'nfs-for-3.14-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[~andy/linux] / fs / nfs / nfs4filelayout.c
index b86464ba25e119711142e2b2959c1647d563f3e6..03fd8be8c0c50b3455ee94ae115fb77fa3d5e4fe 100644 (file)
@@ -91,10 +91,10 @@ static void filelayout_reset_write(struct nfs_write_data *data)
 
        if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) {
                dprintk("%s Reset task %5u for i/o through MDS "
-                       "(req %s/%lld, %u bytes @ offset %llu)\n", __func__,
+                       "(req %s/%llu, %u bytes @ offset %llu)\n", __func__,
                        data->task.tk_pid,
                        hdr->inode->i_sb->s_id,
-                       (long long)NFS_FILEID(hdr->inode),
+                       (unsigned long long)NFS_FILEID(hdr->inode),
                        data->args.count,
                        (unsigned long long)data->args.offset);
 
@@ -112,10 +112,10 @@ static void filelayout_reset_read(struct nfs_read_data *data)
 
        if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) {
                dprintk("%s Reset task %5u for i/o through MDS "
-                       "(req %s/%lld, %u bytes @ offset %llu)\n", __func__,
+                       "(req %s/%llu, %u bytes @ offset %llu)\n", __func__,
                        data->task.tk_pid,
                        hdr->inode->i_sb->s_id,
-                       (long long)NFS_FILEID(hdr->inode),
+                       (unsigned long long)NFS_FILEID(hdr->inode),
                        data->args.count,
                        (unsigned long long)data->args.offset);
 
@@ -1216,17 +1216,17 @@ static void filelayout_recover_commit_reqs(struct list_head *dst,
        struct pnfs_commit_bucket *b;
        int i;
 
-       /* NOTE cinfo->lock is NOT held, relying on fact that this is
-        * only called on single thread per dreq.
-        * Can't take the lock because need to do pnfs_put_lseg
-        */
+       spin_lock(cinfo->lock);
        for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) {
                if (transfer_commit_list(&b->written, dst, cinfo, 0)) {
+                       spin_unlock(cinfo->lock);
                        pnfs_put_lseg(b->wlseg);
                        b->wlseg = NULL;
+                       spin_lock(cinfo->lock);
                }
        }
        cinfo->ds->nwritten = 0;
+       spin_unlock(cinfo->lock);
 }
 
 static unsigned int