From: braam Date: Fri, 21 Jun 2002 23:46:08 +0000 (+0000) Subject: - commit mkdir fix to head as well. Head has slightly better error X-Git-Tag: 0.4.2~90 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2b1727b9b7ca2c954c1e60199a48bcbb5c778621;p=fs%2Flustre-release.git - commit mkdir fix to head as well. Head has slightly better error handling in make empty dir now. --- diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 6f2e813..0262b05 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -635,12 +635,14 @@ int ext2_make_empty(struct inode *inode, struct inode *parent) if (!page) return -ENOMEM; + base = kmap(page); + if (!base) + return -ENOMEM; + err = mapping->a_ops->prepare_write(NULL, page, 0, chunk_size); if (err) goto fail; - base = page_address(page); - de = (struct ext2_dir_entry_2 *) base; de->name_len = 1; de->rec_len = cpu_to_le16(EXT2_DIR_REC_LEN(1)); @@ -657,6 +659,7 @@ int ext2_make_empty(struct inode *inode, struct inode *parent) err = ext2_commit_chunk(page, 0, chunk_size); fail: + kunmap(page); UnlockPage(page); page_cache_release(page); ENTRY;