From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Jeff Layton <jlayton@redhat.com>,
Steve French <sfrench@us.ibm.com>
Subject: [003/119] cifs: clean up handling when server doesnt consistently support inode numbers
Date: Sun, 06 Dec 2009 15:59:39 -0800 [thread overview]
Message-ID: <20091207000641.115073729@mini.kroah.org> (raw)
In-Reply-To: <20091207000938.GA24743@kroah.com>
[-- Attachment #1: cifs-clean-up-handling-when-server-doesn-t-consistently-support-inode-numbers.patch --]
[-- Type: text/plain, Size: 3435 bytes --]
2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit ec06aedd44541129840ed52e6165afa3796a27bf upstream.
It's possible that a server will return a valid FileID when we query the
FILE_INTERNAL_INFO for the root inode, but then zeroed out inode numbers
when we do a FindFile with an infolevel of
SMB_FIND_FILE_ID_FULL_DIR_INFO.
In this situation turn off querying for server inode numbers, generate a
warning for the user and just generate an inode number using iunique.
Once we generate any inode number with iunique we can no longer use any
server inode numbers or we risk collisions, so ensure that we don't do
that in cifs_get_inode_info either.
Reported-by: Timothy Normand Miller <theosib@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/cifs/cifsproto.h | 1 +
fs/cifs/inode.c | 7 ++-----
fs/cifs/misc.c | 14 ++++++++++++++
fs/cifs/readdir.c | 7 ++++---
4 files changed, 21 insertions(+), 8 deletions(-)
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -389,4 +389,5 @@ extern int CIFSSMBSetPosixACL(const int
const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
+extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
#endif /* _CIFSPROTO_H */
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -512,13 +512,10 @@ int cifs_get_inode_info(struct inode **p
cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
- if (rc1) {
+ if (rc1 || !fattr.cf_uniqueid) {
cFYI(1, ("GetSrvInodeNum rc %d", rc1));
fattr.cf_uniqueid = iunique(sb, ROOT_I);
- /* disable serverino if call not supported */
- if (rc1 == -EINVAL)
- cifs_sb->mnt_cifs_flags &=
- ~CIFS_MOUNT_SERVER_INUM;
+ cifs_autodisable_serverino(cifs_sb);
}
} else {
fattr.cf_uniqueid = iunique(sb, ROOT_I);
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -705,3 +705,17 @@ cifsConvertToUCS(__le16 *target, const c
ctoUCS_out:
return i;
}
+
+void
+cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb)
+{
+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
+ cifs_sb->mnt_cifs_flags &= CIFS_MOUNT_SERVER_INUM;
+ cERROR(1, ("Autodisabling the use of server inode numbers on "
+ "%s. This server doesn't seem to support them "
+ "properly. Hardlinks will not be recognized on this "
+ "mount. Consider mounting with the \"noserverino\" "
+ "option to silence this message.",
+ cifs_sb->tcon->treeName));
+ }
+}
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -727,11 +727,12 @@ static int cifs_filldir(char *pfindEntry
cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *)
pfindEntry, cifs_sb);
- /* FIXME: make _to_fattr functions fill this out */
- if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO)
+ if (inum && (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) {
fattr.cf_uniqueid = inum;
- else
+ } else {
fattr.cf_uniqueid = iunique(sb, ROOT_I);
+ cifs_autodisable_serverino(cifs_sb);
+ }
ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr);
next prev parent reply other threads:[~2009-12-07 0:37 UTC|newest]
Thread overview: 133+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091206235936.208334321@mini.kroah.org>
2009-12-07 0:09 ` [000/119] 2.6.31.7-stable review Greg KH
2009-12-06 23:59 ` [001/119] nilfs2: fix kernel oops in error case of nilfs_ioctl_move_blocks Greg KH
2009-12-06 23:59 ` [002/119] cifs: dont use CIFSGetSrvInodeNumber in is_path_accessible Greg KH
2009-12-06 23:59 ` Greg KH [this message]
2009-12-06 23:59 ` [004/119] cifs: clear server inode number flag while autodisabling Greg KH
2009-12-06 23:59 ` [005/119] CIFS: fix oops in cifs_lookup during net boot Greg KH
2009-12-06 23:59 ` [006/119] CIFS: Duplicate data on appending to some Samba servers Greg KH
2009-12-06 23:59 ` [007/119] [SCSI] gdth: Prevent negative offsets in ioctl CVE-2009-3080 Greg KH
2009-12-06 23:59 ` [008/119] rtl8187: Fix kernel oops when device is removed when LEDS enabled Greg KH
2009-12-06 23:59 ` [009/119] md: dont clear endpoint for resync when resync is interrupted Greg KH
2009-12-06 23:59 ` [010/119] md/raid5: make sure curr_sync_completes is uptodate when reshape starts Greg KH
2009-12-06 23:59 ` [011/119] md/raid1/raid10: add a cond_resched Greg KH
2009-12-06 23:59 ` [012/119] ALSA: usb-audio: fix combine_word problem Greg KH
2009-12-06 23:59 ` [013/119] ALSA: hda - Dell Studio 1557 hd-audio quirk Greg KH
2009-12-06 23:59 ` [014/119] ALSA: AACI: fix AC97 multiple-open bug Greg KH
2009-12-06 23:59 ` [015/119] ALSA: AACI: fix recording bug Greg KH
2009-12-06 23:59 ` [016/119] jffs2: Fix memory corruption in jffs2_read_inode_range() Greg KH
2009-12-06 23:59 ` [017/119] sound: rawmidi: disable active-sensing-on-close by default Greg KH
2009-12-06 23:59 ` [018/119] sound: rawmidi: fix checking of O_APPEND when opening MIDI device Greg KH
2009-12-06 23:59 ` [019/119] sound: rawmidi: fix double init when opening MIDI device with O_APPEND Greg KH
2009-12-06 23:59 ` [020/119] sound: rawmidi: fix MIDI device O_APPEND error handling Greg KH
2009-12-06 23:59 ` [021/119] highmem: Fix race in debug_kmap_atomic() which could cause warn_count to underflow Greg KH
2009-12-06 23:59 ` [022/119] highmem: Fix debug_kmap_atomic() to also handle KM_IRQ_PTE, KM_NMI, and KM_NMI_PTE Greg KH
2009-12-07 1:11 ` Hugh Dickins
2009-12-07 9:50 ` Florian Mickler
2009-12-06 23:59 ` [023/119] V4L/DVB (13169): bttv: Fix potential out-of-order field processing Greg KH
2009-12-07 0:00 ` [024/119] V4L/DVB (13170): bttv: Fix reversed polarity error when switching video standard Greg KH
2009-12-07 0:00 ` [025/119] V4L/DVB (13109): tda18271: fix signedness issue in tda18271_rf_tracking_filters_init Greg KH
2009-12-07 0:00 ` [026/119] V4L/DVB (13107): tda18271: fix overflow in FM radio frequency calculation Greg KH
2009-12-07 0:00 ` [027/119] V4L/DVB (13190): em28xx: fix panic that can occur when starting audio streaming Greg KH
2009-12-07 0:00 ` [028/119] V4L/DVB (13079): dib0700: fixed xc2028 firmware loading kernel oops Greg KH
2009-12-07 0:00 ` [029/119] V4L/DVB (13230): s2255drv: Dont conditionalize video buffer completion on waiting processes Greg KH
2009-12-07 0:00 ` [030/119] uids: Prevent tear down race Greg KH
2009-12-07 0:00 ` [031/119] pps: events reporting fix up Greg KH
2009-12-07 0:00 ` [032/119] pps: locking scheme fix up for PPS_GETPARAMS Greg KH
2009-12-07 0:00 ` [033/119] rtc: v3020: fix v3020_mmio_read_bit() Greg KH
2009-12-07 0:00 ` [034/119] fs: add missing compat_ptr handling for FS_IOC_RESVSP ioctl Greg KH
2009-12-07 0:00 ` [035/119] memcg: fix wrong pointer initialization at page migration when memcg is disabled Greg KH
2009-12-07 0:00 ` [036/119] pidns: fix a leak in /proc dentries and inodes with pid namespaces Greg KH
2009-12-07 0:00 ` [037/119] page allocator: Do not allow interrupts to use ALLOC_HARDER Greg KH
2009-12-07 0:00 ` [038/119] page allocator: always wake kswapd when restarting an allocation attempt after direct reclaim failed Greg KH
2009-12-07 0:00 ` [039/119] tty_port: If we are opened non blocking we still need to raise the carrier Greg KH
2009-12-07 0:00 ` [040/119] tty: cp210x: Fix carrier handling Greg KH
2009-12-07 0:00 ` [041/119] USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer Greg KH
2009-12-07 16:04 ` [Stable-review] " Stefan Bader
2009-12-07 16:48 ` Greg KH
2009-12-07 20:19 ` Stefan Bader
2009-12-07 0:00 ` [042/119] USB: usbmon: fix bug in mon_buff_area_shrink Greg KH
2009-12-07 0:00 ` [043/119] USB: option.c: add support for D-Link DWM-162-U5 Greg KH
2009-12-07 0:00 ` [044/119] USB: cdc_acm: Fix race condition when opening tty Greg KH
2009-12-07 0:00 ` [045/119] USB: xhci: Fix bug memory free after failed initialization Greg KH
2009-12-07 0:00 ` [046/119] USB: xhci: Fix TRB physical to virtual address translation Greg KH
2009-12-07 0:00 ` [047/119] USB: xhci: Fix scratchpad deallocation Greg KH
2009-12-07 0:00 ` [048/119] iwlwifi: Use RTS/CTS as the preferred protection mechanism for 6000 series Greg KH
2009-12-07 0:00 ` [049/119] iwlwifi: Fix issue on file transfer stalled in HT mode Greg KH
2009-12-07 0:00 ` [050/119] ima: replace GFP_KERNEL with GFP_NOFS Greg KH
2009-12-07 0:00 ` [051/119] NFSv4: Fix a cache validation bug which causes getcwd() to return ENOENT Greg KH
2009-12-07 0:00 ` [052/119] fuse: reject O_DIRECT flag also in fuse_create Greg KH
2009-12-07 0:00 ` [053/119] ASoC: Fix suspend with active audio streams Greg KH
2009-12-07 0:00 ` [054/119] ASoC: AIC23: Fixing infinite loop in resume path Greg KH
2009-12-07 0:00 ` [055/119] mac80211: fix two remote exploits Greg KH
2009-12-07 0:00 ` [056/119] mac80211: fix spurious delBA handling Greg KH
2009-12-07 0:00 ` [057/119] b43: Work around mac80211 race condition Greg KH
2009-12-07 0:00 ` [058/119] rfkill: fix miscdev ops Greg KH
2009-12-07 0:00 ` [059/119] thinkpad-acpi: fix sign of ERESTARTSYS return Greg KH
2009-12-07 0:00 ` [060/119] [CPUFREQ] Enable ACPI PDC handshake for VIA/Centaur CPUs Greg KH
2009-12-07 0:00 ` [061/119] V4L/DVB (13436): cxusb: Fix hang on DViCO FusionHDTV DVB-T Dual Digital 4 (rev 1) Greg KH
2009-12-07 0:00 ` [062/119] V4L/DVB (13321): radio-gemtek-pci: fix double mutex_lock Greg KH
2009-12-07 0:00 ` [063/119] V4L/DVB (12948): v4l1-compat: fix VIDIOC_G_STD handling Greg KH
2009-12-07 0:00 ` [064/119] V4L/DVB (12280): gspca - sonixj: Remove auto gain/wb/expo for the ov7660 sensor Greg KH
2009-12-07 0:00 ` [065/119] V4L/DVB (12356): gspca - sonixj: Webcam 0c45:6148 added Greg KH
2009-12-07 15:59 ` [Stable-review] " Stefan Bader
2009-12-07 16:48 ` Greg KH
2009-12-07 20:19 ` Stefan Bader
2009-12-07 0:00 ` [066/119] V4L/DVB (12501): gspca - sonixj: Do the ov7660 sensor work again Greg KH
2009-12-07 0:00 ` [067/119] V4L/DVB (12691): gspca - sonixj: Dont use mdelay() Greg KH
2009-12-07 0:00 ` [068/119] V4L/DVB (12696): gspca - sonixj / sn9c102: Two drivers for 0c45:60fc and 0c45:613e Greg KH
2009-12-07 0:00 ` [069/119] drm/i915: Select CONFIG_SHMEM Greg KH
2009-12-07 0:00 ` [070/119] drm: work around EDIDs with bad htotal/vtotal values Greg KH
2009-12-07 0:00 ` [071/119] drm/i915: Fix IRQ stall issue on Ironlake Greg KH
2009-12-07 0:00 ` [072/119] udp: Fix udp_poll() and ioctl() Greg KH
2009-12-07 0:00 ` [073/119] acenic: Pass up error code from ace_load_firmware() Greg KH
2009-12-07 0:00 ` [074/119] pkt_sched: pedit use proper struct Greg KH
2009-12-07 0:00 ` [075/119] net: fix sk_forward_alloc corruption Greg KH
2009-12-07 0:00 ` [076/119] bonding: Modify hash transmit policies to use the packets source MAC address Greg KH
2009-12-07 0:00 ` [077/119] sfc: Set ip_summed correctly for page buffers passed to GRO Greg KH
2009-12-07 0:00 ` [078/119] sparc64: replace parentheses in pmul() Greg KH
2009-12-07 0:00 ` [079/119] sparc: Move of_set_property_mutex acquisition outside of devtree_lock grab Greg KH
2009-12-07 0:00 ` [080/119] sched: Fix boot crash by zalloc()ing most of the cpu masks Greg KH
2009-12-08 1:39 ` Rusty Russell
2009-12-08 17:54 ` Greg KH
2009-12-07 0:00 ` [081/119] V4L/DVB (13202): smsusb: add autodetection support for three additional Hauppauge USB IDs Greg KH
2009-12-07 0:00 ` [082/119] V4L/DVB (13313): saa7134: add support for FORCE_TS_VALID mode for mpeg ts input Greg KH
2009-12-07 0:00 ` [083/119] V4L/DVB (13314): saa7134: set ts_force_val for the Hauppauge WinTV HVR-1150 Greg KH
2009-12-07 0:01 ` [084/119] ipv4: additional update of dev_net(dev) to struct *net in ip_fragment.c, NULL ptr OOPS Greg KH
2009-12-07 0:01 ` [085/119] [CPUFREQ] speedstep-ich: fix error caused by 394122ab144dae4b276d74644a2f11c44a60ac5c Greg KH
2009-12-07 0:01 ` [086/119] USB: EHCI: dont send Clear-TT-Buffer following a STALL Greg KH
2009-12-07 0:01 ` [087/119] USB: musb_gadget: fix STALL handling Greg KH
2009-12-07 0:01 ` [088/119] usb: amd5536udc: fixed shared interrupt bug and warning oops Greg KH
2009-12-07 0:01 ` [089/119] USB: ftdi_sio: Keep going when write errors are encountered Greg KH
2009-12-07 0:01 ` [090/119] USB: work around for EHCI with quirky periodic schedules Greg KH
2009-12-07 0:01 ` [091/119] tty_port: handle the nonblocking open of a dead port corner case Greg KH
2009-12-07 0:01 ` [092/119] [ARM] pxamci: call mmc_remove_host() before freeing resources Greg KH
2009-12-07 0:01 ` [093/119] param: dont complain about unused module parameters Greg KH
2009-12-07 0:01 ` [094/119] modules: dont export section names of empty sections via sysfs Greg KH
2009-12-07 0:01 ` [095/119] md: revert incorrect fix for read error handling in raid1 Greg KH
2009-12-07 0:01 ` [096/119] perf_event: Adjust frequency and unthrottle for non-group-leader events Greg KH
2009-12-07 0:01 ` [097/119] hso: fix soft-lockup Greg KH
2009-12-07 0:01 ` [098/119] block: use after free bug in __blkdev_get Greg KH
2009-12-07 0:01 ` [099/119] hwmon: (adt7475) Fix temperature fault flags Greg KH
2009-12-07 0:01 ` [100/119] hwmon: (adt7475) Cache limits for 60 seconds Greg KH
2009-12-07 0:01 ` [101/119] agp/intel: new host bridge support Greg KH
2009-12-07 0:01 ` [102/119] netfilter: nf_nat: fix NAT issue in 2.6.30.4+ Greg KH
2009-12-07 0:01 ` [103/119] netfilter: xt_connlimit: fix regression caused by zero family value Greg KH
2009-12-07 0:01 ` [104/119] b43: Fix DMA TX bounce buffer copying Greg KH
2009-12-07 0:01 ` [105/119] crypto: padlock-aes - Use the correct mask when checking whether copying is required Greg KH
2009-12-07 0:01 ` [106/119] sky2: set carrier off in probe Greg KH
2009-12-07 0:01 ` [107/119] ath5k: Linear PCDAC code fixes Greg KH
2009-12-07 0:01 ` [108/119] i2c: Fix userspace_device list corruption Greg KH
2009-12-07 0:01 ` [109/119] acerhdf: fix fan control for AOA150 model Greg KH
2009-12-07 0:01 ` [110/119] drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling Greg KH
2009-12-07 0:01 ` [111/119] tty/of_serial: add missing ns16550a id Greg KH
2009-12-07 0:01 ` [112/119] V4L/DVB (13255): gspca - m5602-s5k4aa: Add vflip quirk for the Bruneinit laptop Greg KH
2009-12-07 0:01 ` [113/119] V4L/DVB (13256): gspca - m5602-s5k4aa: Add another MSI GX700 vflip quirk Greg KH
2009-12-07 0:01 ` [114/119] V4L/DVB (13257): gspca - m5602-s5k4aa: Add vflip for Fujitsu Amilo Xi 2528 Greg KH
2009-12-07 0:01 ` [115/119] PCI: Prevent AER driver from being loaded on non-root port PCIE devices Greg KH
2009-12-07 0:01 ` [116/119] acerhdf: additional BIOS versions Greg KH
2009-12-07 0:01 ` [117/119] acerhdf: return temperature in milidegree instead of degree Greg KH
2009-12-07 0:01 ` [118/119] Input: keyboard - fix braille keyboard keysym generation Greg KH
2009-12-07 0:01 ` [119/119] isdn: hfc_usb: Fix read buffer overflow Greg KH
2009-12-07 0:10 ` [000/119] 2.6.31.7-stable review Greg KH
2009-12-07 0:33 ` Alexander Beregalov
2009-12-07 0:37 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091207000641.115073729@mini.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jlayton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sfrench@us.ibm.com \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox