Whamcloud - gitweb
b=21502 symlink compatibility between 1.6 and 2.0
authorRahul Deshmukh <Rahul.Deshmukh@sun.com>
Tue, 4 May 2010 15:16:01 +0000 (20:46 +0530)
committerRobert Read <robert.read@oracle.com>
Tue, 4 May 2010 23:12:07 +0000 (16:12 -0700)
Fixed the sleep in spin lock, inode->i_sb->s_op-> dirty_inode(inode)
was called with spin lock held.

i=bzzz
i=pravin

lustre/osd/osd_handler.c

index cf60236..b826a71 100644 (file)
@@ -2450,6 +2450,7 @@ static int osd_ldiskfs_write_record(struct inode *inode, void *buf, int bufsize,
         int err = 0;
         int size;
         int boffs;
         int err = 0;
         int size;
         int boffs;
+        int dirty_inode = 0;
 
         while (bufsize > 0) {
                 if (bh != NULL)
 
         while (bufsize > 0) {
                 if (bh != NULL)
@@ -2494,9 +2495,11 @@ static int osd_ldiskfs_write_record(struct inode *inode, void *buf, int bufsize,
                         i_size_write(inode, new_size);
                 if (i_size_read(inode) > LDISKFS_I(inode)->i_disksize) {
                         LDISKFS_I(inode)->i_disksize = i_size_read(inode);
                         i_size_write(inode, new_size);
                 if (i_size_read(inode) > LDISKFS_I(inode)->i_disksize) {
                         LDISKFS_I(inode)->i_disksize = i_size_read(inode);
-                        inode->i_sb->s_op->dirty_inode(inode);
+                        dirty_inode = 1;
                 }
                 spin_unlock(&inode->i_lock);
                 }
                 spin_unlock(&inode->i_lock);
+                if (dirty_inode)
+                        inode->i_sb->s_op->dirty_inode(inode);
         }
 
         if (err == 0)
         }
 
         if (err == 0)