Whamcloud - gitweb
Make sure i_blksize is set, and limit it to 4MB (LL_MAX_BLKSIZE) for broken
authoradilger <adilger>
Mon, 1 Mar 2004 21:28:31 +0000 (21:28 +0000)
committeradilger <adilger>
Mon, 1 Mar 2004 21:28:31 +0000 (21:28 +0000)
user-space apps.
b=2844

lustre/llite/llite_internal.h
lustre/llite/llite_lib.c

index c0ca902..84c910f 100644 (file)
@@ -110,7 +110,7 @@ struct ll_async_page {
         struct page     *llap_page;
         struct list_head llap_pending_write;
          /* only trust these if the page lock is providing exclusion */
-         int             llap_write_queued:1,
+        int              llap_write_queued:1,
                          llap_defer_uptodate:1;
         struct list_head llap_proc_item;
 };
@@ -249,6 +249,8 @@ int ll_close_thread_start(struct ll_close_queue **lcq_ret);
 #define LL_SBI_NOLCK            0x1
 #define LL_SBI_READAHEAD        0x2
 
+#define LL_MAX_BLKSIZE          (4UL * 1024 * 1024)
+
 #if  (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
 #define    ll_s2sbi(sb)     ((struct ll_sb_info *)((sb)->s_fs_info))
 void __d_rehash(struct dentry * entry, int lock);
index ceaa4e0..926e83d 100644 (file)
@@ -1053,6 +1053,9 @@ void ll_update_inode(struct inode *inode, struct mds_body *body,
                                 LBUG();
                         }
                 }
+                /* bug 2844 - limit i_blksize for broken user-space apps */
+                LASSERTF(lsm->lsm_xfersize != 0, "%lu\n", lsm->lsm_xfersize);
+                inode->i_blksize = min(lsm->lsm_xfersize, LL_MAX_BLKSIZE);
                 if (lli->lli_smd != lsm)
                         obd_free_memmd(ll_i2obdexp(inode), &lsm);
         }