From 6c3798a2f51b1872886da6222625d470be0a3861 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 3 Aug 2007 11:25:50 -0400 Subject: [PATCH] --- yaml --- r: 64039 b: refs/heads/master c: 6a286a6d85bb0da687011b15f268c0e52e8eaba4 h: refs/heads/master i: 64037: d70d7d21f34994a2f8ed0574aa17112c4a5acd18 64035: b3af453afe376994d3a83db5576d9f1413f3819e 64031: 027a8c479e403934d6a2404b5b1d1943d5c67d44 v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 2 +- trunk/arch/i386/boot/edd.c | 54 +++++++++++++++++++++++++-------- trunk/arch/i386/boot/video.c | 2 +- trunk/drivers/ata/pata_isapnp.c | 2 ++ trunk/fs/cifs/CHANGES | 5 +-- trunk/fs/cifs/README | 13 -------- trunk/fs/cifs/TODO | 3 +- trunk/fs/cifs/file.c | 33 ++++++-------------- trunk/fs/cifs/sess.c | 4 --- trunk/fs/exec.c | 13 +++----- 11 files changed, 64 insertions(+), 69 deletions(-) diff --git a/[refs] b/[refs] index e2ac288a3987..afaf504730d6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b2d597cb6d64d5e30236273249e3790434387743 +refs/heads/master: 6a286a6d85bb0da687011b15f268c0e52e8eaba4 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 371fe67a4eef..e4dde7f1f8d2 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -1009,7 +1009,7 @@ P: Steve French M: sfrench@samba.org L: linux-cifs-client@lists.samba.org L: samba-technical@lists.samba.org -W: http://linux-cifs.samba.org/ +W: http://us1.samba.org/samba/Linux_CIFS_client.html T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git S: Supported diff --git a/trunk/arch/i386/boot/edd.c b/trunk/arch/i386/boot/edd.c index 82b5c846a194..658834d9f92a 100644 --- a/trunk/arch/i386/boot/edd.c +++ b/trunk/arch/i386/boot/edd.c @@ -19,12 +19,40 @@ #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) +struct edd_dapa { + u8 pkt_size; + u8 rsvd; + u16 sector_cnt; + u16 buf_off, buf_seg; + u64 lba; + u64 buf_lin_addr; +}; + /* * Read the MBR (first sector) from a specific device. */ static int read_mbr(u8 devno, void *buf) { - u16 ax, bx, cx, dx; + struct edd_dapa dapa; + u16 ax, bx, cx, dx, si; + + memset(&dapa, 0, sizeof dapa); + dapa.pkt_size = sizeof(dapa); + dapa.sector_cnt = 1; + dapa.buf_off = (size_t)buf; + dapa.buf_seg = ds(); + /* dapa.lba = 0; */ + + ax = 0x4200; /* Extended Read */ + si = (size_t)&dapa; + dx = devno; + asm("pushfl; stc; int $0x13; setc %%al; popfl" + : "+a" (ax), "+S" (si), "+d" (dx) + : "m" (dapa) + : "ebx", "ecx", "edi", "memory"); + + if (!(u8)ax) + return 0; /* OK */ ax = 0x0201; /* Legacy Read, one sector */ cx = 0x0001; /* Sector 0-0-1 */ @@ -37,10 +65,11 @@ static int read_mbr(u8 devno, void *buf) return -(u8)ax; /* 0 or -1 */ } -static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig) +static u32 read_mbr_sig(u8 devno, struct edd_info *ei) { int sector_size; char *mbrbuf_ptr, *mbrbuf_end; + u32 mbrsig; u32 buf_base, mbr_base; extern char _end[]; @@ -56,15 +85,15 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig) /* Make sure we actually have space on the heap... */ if (!(boot_params.hdr.loadflags & CAN_USE_HEAP)) - return -1; + return 0; if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr) - return -1; + return 0; if (read_mbr(devno, mbrbuf_ptr)) - return -1; + return 0; - *mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET]; - return 0; + mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET]; + return mbrsig; } static int get_edd_info(u8 devno, struct edd_info *ei) @@ -131,7 +160,6 @@ void query_edd(void) int do_edd = 1; int devno; struct edd_info ei, *edp; - u32 *mbrptr; if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) { if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) @@ -140,8 +168,7 @@ void query_edd(void) do_edd = 0; } - edp = boot_params.eddbuf; - mbrptr = boot_params.edd_mbr_sig_buffer; + edp = (struct edd_info *)boot_params.eddbuf; if (!do_edd) return; @@ -159,8 +186,11 @@ void query_edd(void) boot_params.eddbuf_entries++; } - if (do_mbr && !read_mbr_sig(devno, &ei, mbrptr++)) - boot_params.edd_mbr_sig_buf_entries = devno-0x80+1; + if (do_mbr) { + u32 mbr_sig; + mbr_sig = read_mbr_sig(devno, &ei); + boot_params.edd_mbr_sig_buffer[devno-0x80] = mbr_sig; + } } } diff --git a/trunk/arch/i386/boot/video.c b/trunk/arch/i386/boot/video.c index 693f20d3102e..958130ef0042 100644 --- a/trunk/arch/i386/boot/video.c +++ b/trunk/arch/i386/boot/video.c @@ -61,7 +61,7 @@ static void store_video_mode(void) /* Not all BIOSes are clean with respect to the top bit */ boot_params.screen_info.orig_video_mode = ax & 0x7f; - boot_params.screen_info.orig_video_page = page >> 8; + boot_params.screen_info.orig_video_page = page; } /* diff --git a/trunk/drivers/ata/pata_isapnp.c b/trunk/drivers/ata/pata_isapnp.c index 5525518204e6..91a396fa5b20 100644 --- a/trunk/drivers/ata/pata_isapnp.c +++ b/trunk/drivers/ata/pata_isapnp.c @@ -139,6 +139,8 @@ static struct pnp_device_id isapnp_devices[] = { {.id = ""} }; +MODULE_DEVICE_TABLE(pnp, isapnp_devices); + static struct pnp_driver isapnp_driver = { .name = DRV_NAME, .id_table = isapnp_devices, diff --git a/trunk/fs/cifs/CHANGES b/trunk/fs/cifs/CHANGES index bed6215c0794..6d84ca2beead 100644 --- a/trunk/fs/cifs/CHANGES +++ b/trunk/fs/cifs/CHANGES @@ -3,10 +3,7 @@ Version 1.50 Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is done with "serverino" mount option). Add support for POSIX Unlink (helps with certain sharing violation cases when server such as -Samba supports newer POSIX CIFS Protocol Extensions). Add "nounix" -mount option to allow disabling the CIFS Unix Extensions for just -that mount. Fix hang on spinlock in find_writable_file (race when -reopening file after session crash). +Samba supports newer POSIX CIFS Protocol Extensions). Version 1.49 ------------ diff --git a/trunk/fs/cifs/README b/trunk/fs/cifs/README index b806b11b5560..85f1eb14083e 100644 --- a/trunk/fs/cifs/README +++ b/trunk/fs/cifs/README @@ -444,13 +444,6 @@ A partial list of the supported mount options follows: noposixpaths If CIFS Unix extensions are supported, do not request posix path name support (this may cause servers to reject creatingfile with certain reserved characters). - nounix Disable the CIFS Unix Extensions for this mount (tree - connection). This is rarely needed, but it may be useful - in order to turn off multiple settings all at once (ie - posix acls, posix locks, posix paths, symlink support - and retrieving uids/gids/mode from the server) or to - work around a bug in server which implement the Unix - Extensions. nobrl Do not send byte range lock requests to the server. This is necessary for certain applications that break with cifs style mandatory byte range locks (and most @@ -458,12 +451,6 @@ A partial list of the supported mount options follows: byte range locks). remount remount the share (often used to change from ro to rw mounts or vice versa) - servern Specify the server 's netbios name (RFC1001 name) to use - when attempting to setup a session to the server. This is - This is needed for mounting to some older servers (such - as OS/2 or Windows 98 and Windows ME) since they do not - support a default server name. A server name can be up - to 15 characters long and is usually uppercased. sfu When the CIFS Unix Extensions are not negotiated, attempt to create device files and fifos in a format compatible with Services for Unix (SFU). In addition retrieve bits 10-12 diff --git a/trunk/fs/cifs/TODO b/trunk/fs/cifs/TODO index 29d4b2715254..d7bd51575fd6 100644 --- a/trunk/fs/cifs/TODO +++ b/trunk/fs/cifs/TODO @@ -82,7 +82,8 @@ u) DOS attrs - returned as pseudo-xattr in Samba format (check VFAT and NTFS for v) mount check for unmatched uids -w) Add support for new vfs entry points for setlease and fallocate +w) Add mount option for Linux extension disable per mount, and partial +disable per mount (uid off, symlink/fifo/mknod on but what about posix acls?) x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of processes can proceed better in parallel (on the server) diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index 894b1f7b299d..e13592afca9c 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -1904,25 +1904,6 @@ static int cifs_readpage(struct file *file, struct page *page) return rc; } -static int is_inode_writable(struct cifsInodeInfo *cifs_inode) -{ - struct cifsFileInfo *open_file; - - read_lock(&GlobalSMBSeslock); - list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { - if (open_file->closePend) - continue; - if (open_file->pfile && - ((open_file->pfile->f_flags & O_RDWR) || - (open_file->pfile->f_flags & O_WRONLY))) { - read_unlock(&GlobalSMBSeslock); - return 1; - } - } - read_unlock(&GlobalSMBSeslock); - return 0; -} - /* We do not want to update the file size from server for inodes open for write - to avoid races with writepage extending the file - in the future we could consider allowing @@ -1931,13 +1912,19 @@ static int is_inode_writable(struct cifsInodeInfo *cifs_inode) page caching in the current Linux kernel design */ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) { - if (!cifsInode) - return 1; + struct cifsFileInfo *open_file = NULL; + + if (cifsInode) + open_file = find_writable_file(cifsInode); - if (is_inode_writable(cifsInode)) { - /* This inode is open for write at least once */ + if (open_file) { struct cifs_sb_info *cifs_sb; + /* there is not actually a write pending so let + this handle go free and allow it to + be closable if needed */ + atomic_dec(&open_file->wrtPending); + cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb); if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) { /* since no page cache to corrupt on directio diff --git a/trunk/fs/cifs/sess.c b/trunk/fs/cifs/sess.c index 892be9b4d1f3..2ea027dda215 100644 --- a/trunk/fs/cifs/sess.c +++ b/trunk/fs/cifs/sess.c @@ -372,10 +372,6 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, /* 2000 big enough to fit max user, domain, NOS name etc. */ str_area = kmalloc(2000, GFP_KERNEL); - if (str_area == NULL) { - cifs_small_buf_release(smb_buf); - return -ENOMEM; - } bcc_ptr = str_area; ses->flags &= ~CIFS_SES_LANMAN; diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index ce62f7b65f17..7bdea7937ee8 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -1084,12 +1084,9 @@ int flush_old_exec(struct linux_binprm * bprm) */ current->mm->task_size = TASK_SIZE; - if (bprm->e_uid != current->euid || bprm->e_gid != current->egid) { - suid_keys(current); - set_dumpable(current->mm, suid_dumpable); - current->pdeath_signal = 0; - } else if (file_permission(bprm->file, MAY_READ) || - (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) { + if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || + file_permission(bprm->file, MAY_READ) || + (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) { suid_keys(current); set_dumpable(current->mm, suid_dumpable); } @@ -1180,10 +1177,8 @@ void compute_creds(struct linux_binprm *bprm) { int unsafe; - if (bprm->e_uid != current->uid) { + if (bprm->e_uid != current->uid) suid_keys(current); - current->pdeath_signal = 0; - } exec_keys(current); task_lock(current);